Skip to content

Commit 0152f78

Browse files
AsifNawaz-cnicKaiSchwarz-cnic
authored andcommitted
fix(Response.java): Refactored the code to return sorted plain command results.
1 parent 657b285 commit 0152f78

File tree

8 files changed

+318
-109
lines changed

8 files changed

+318
-109
lines changed

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// .devcontainer/devcontainer.json
2+
{
3+
"name": "Java",
4+
"image": "mcr.microsoft.com/devcontainers/java",
5+
"customizations": {
6+
"vscode": {
7+
"settings": {
8+
"terminal.integrated.shell.linux": "/bin/bash"
9+
}
10+
},
11+
"extensions": [
12+
"vscjava.vscode-java-pack"
13+
]
14+
}
15+
}

.github/linters/sun_checks.xml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
6+
<!--
7+
8+
Checkstyle configuration that checks the sun coding conventions from:
9+
10+
- the Java Language Specification at
11+
https://docs.oracle.com/javase/specs/jls/se11/html/index.html
12+
13+
- the Sun Code Conventions at https://www.oracle.com/java/technologies/javase/codeconventions-contents.html
14+
15+
- the Javadoc guidelines at
16+
https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html
17+
18+
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
19+
20+
- some best practices
21+
22+
Checkstyle is very configurable. Be sure to read the documentation at
23+
https://checkstyle.org (or in your downloaded distribution).
24+
25+
Most Checks are configurable, be sure to consult the documentation.
26+
27+
To completely disable a check, just comment it out or delete it from the file.
28+
To suppress certain violations please review suppression filters.
29+
30+
Finally, it is worth reading the documentation.
31+
32+
-->
33+
34+
<module name="Checker">
35+
<!--
36+
If you set the basedir property below, then all reported file
37+
names will be relative to the specified directory. See
38+
https://checkstyle.org/config.html#Checker
39+
40+
<property name="basedir" value="${basedir}"/>
41+
-->
42+
<property name="severity" value="error"/>
43+
44+
<property name="fileExtensions" value="java, properties, xml"/>
45+
46+
<!-- Excludes all 'module-info.java' files -->
47+
<!-- See https://checkstyle.org/config_filefilters.html -->
48+
<module name="BeforeExecutionExclusionFileFilter">
49+
<property name="fileNamePattern" value="module\-info\.java$"/>
50+
</module>
51+
52+
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
53+
<module name="SuppressionFilter">
54+
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}" default="checkstyle-suppressions.xml" />
55+
<property name="optional" value="true"/>
56+
</module>
57+
58+
<!-- Checks that a package-info.java file exists for each package. -->
59+
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
60+
<!-- <module name="JavadocPackage"/> -->
61+
62+
<!-- Checks whether files end with a new line. -->
63+
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
64+
<module name="NewlineAtEndOfFile"/>
65+
66+
<!-- Checks that property files contain the same keys. -->
67+
<!-- See https://checkstyle.org/config_misc.html#Translation -->
68+
<module name="Translation"/>
69+
70+
<!-- Checks for whitespace -->
71+
<!-- See https://checkstyle.org/config_whitespace.html -->
72+
<module name="FileTabCharacter"/>
73+
74+
<!-- Miscellaneous other checks. -->
75+
<!-- See https://checkstyle.org/config_misc.html -->
76+
<module name="RegexpSingleline">
77+
<property name="format" value="\s+$"/>
78+
<property name="minimum" value="0"/>
79+
<property name="maximum" value="0"/>
80+
<property name="message" value="Line has trailing spaces."/>
81+
</module>
82+
83+
<!-- Enables @SuppressWarnings Support -->
84+
<module name="SuppressWarningsFilter"/>
85+
<module name="TreeWalker">
86+
87+
<!-- Checks for Javadoc comments. -->
88+
<!-- See https://checkstyle.org/config_javadoc.html -->
89+
<module name="InvalidJavadocPosition"/>
90+
<module name="JavadocMethod"/>
91+
<module name="JavadocType"/>
92+
<module name="JavadocVariable"/>
93+
<module name="MissingJavadocMethod"/>
94+
<!-- Enables @SuppressWarnings Support -->
95+
<module name="SuppressWarningsHolder"/>
96+
97+
<!-- Checks for Naming Conventions. -->
98+
<!-- See https://checkstyle.org/config_naming.html -->
99+
<module name="ConstantName"/>
100+
<module name="LocalFinalVariableName"/>
101+
<module name="LocalVariableName"/>
102+
<module name="MemberName"/>
103+
<module name="MethodName"/>
104+
<module name="PackageName"/>
105+
<module name="ParameterName"/>
106+
<module name="StaticVariableName"/>
107+
<module name="TypeName"/>
108+
109+
<!-- Checks for imports -->
110+
<!-- See https://checkstyle.org/config_imports.html -->
111+
<module name="AvoidStarImport"/>
112+
<module name="IllegalImport"/>
113+
<!-- defaults to sun.* packages -->
114+
<module name="RedundantImport"/>
115+
<module name="UnusedImports">
116+
<property name="processJavadoc" value="false"/>
117+
</module>
118+
119+
<!-- Checks for Size Violations. -->
120+
<!-- See https://checkstyle.org/config_sizes.html -->
121+
<module name="MethodLength"/>
122+
<module name="ParameterNumber"/>
123+
124+
<!-- Checks for whitespace -->
125+
<!-- See https://checkstyle.org/config_whitespace.html -->
126+
<module name="EmptyForIteratorPad"/>
127+
<module name="GenericWhitespace"/>
128+
<module name="MethodParamPad"/>
129+
<module name="NoWhitespaceAfter"/>
130+
<module name="NoWhitespaceBefore"/>
131+
<module name="OperatorWrap"/>
132+
<module name="ParenPad"/>
133+
<module name="TypecastParenPad"/>
134+
<module name="WhitespaceAfter"/>
135+
<module name="WhitespaceAround"/>
136+
137+
<!-- Modifier Checks -->
138+
<!-- See https://checkstyle.org/config_modifiers.html -->
139+
<module name="ModifierOrder"/>
140+
<module name="RedundantModifier"/>
141+
142+
<!-- Checks for blocks. You know, those {}'s -->
143+
<!-- See https://checkstyle.org/config_blocks.html -->
144+
<module name="AvoidNestedBlocks"/>
145+
<module name="EmptyBlock"/>
146+
<module name="LeftCurly"/>
147+
<module name="NeedBraces"/>
148+
<module name="RightCurly"/>
149+
150+
<!-- Checks for common coding problems -->
151+
<!-- See https://checkstyle.org/config_coding.html -->
152+
<module name="EmptyStatement"/>
153+
<module name="EqualsHashCode"/>
154+
<module name="IllegalInstantiation"/>
155+
<module name="InnerAssignment"/>
156+
<module name="MagicNumber"/>
157+
<module name="MissingSwitchDefault"/>
158+
<module name="MultipleVariableDeclarations"/>
159+
<module name="SimplifyBooleanExpression"/>
160+
<module name="SimplifyBooleanReturn"/>
161+
162+
<!-- Checks for class design -->
163+
<!-- See https://checkstyle.org/config_design.html -->
164+
<module name="DesignForExtension"/>
165+
<module name="FinalClass"/>
166+
<module name="HideUtilityClassConstructor"/>
167+
<module name="InterfaceIsType"/>
168+
<module name="VisibilityModifier"/>
169+
170+
<!-- Miscellaneous other checks. -->
171+
<!-- See https://checkstyle.org/config_misc.html -->
172+
<module name="ArrayTypeStyle"/>
173+
<module name="TodoComment"/>
174+
<module name="UpperEll"/>
175+
176+
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
177+
<module name="SuppressionXpathFilter">
178+
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}" default="checkstyle-xpath-suppressions.xml" />
179+
<property name="optional" value="true"/>
180+
</module>
181+
182+
</module>
183+
184+
</module>

.github/workflows/auto-merge-dependabot-pr.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@ on:
55
- opened
66
- synchronize
77

8-
permissions:
9-
contents: write
10-
pull-requests: write
11-
128
jobs:
139
tests:
1410
uses: ./.github/workflows/test.yml
1511
secrets: inherit
16-
12+
permissions:
13+
contents: read
14+
1715
dependabot:
16+
if: ${{ github.actor == 'dependabot[bot]' }}
1817
name: Auto-merge Dependabot PR
1918
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
2019
needs: tests
21-
if: ${{ github.actor == 'dependabot[bot]' }}
20+
permissions:
21+
contents: write
22+
pull-requests: write
2223
steps:
2324
- name: Dependabot metadata
2425
id: metadata
@@ -31,4 +32,4 @@ jobs:
3132
run: gh pr merge --auto --merge "$PR_URL"
3233
env:
3334
PR_URL: ${{github.event.pull_request.html_url}}
34-
GITHUB_TOKEN: ${{secrets.RTLDEV_MW_CI_TOKEN}}
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
packages: write
1414

1515
release:
16-
name: Release @ ubuntu-latest
16+
name: Release
1717
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
18+
needs: build
1819
permissions:
1920
contents: write
2021
issues: write
21-
deployments: write
22-
needs: build
22+
deployments: write
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v4

.github/workflows/test.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ on:
44
workflow_call:
55

66
jobs:
7-
# separate job to set as required in branch protection,
8-
# as the build names above change each time Node versions change
97
lint:
108
name: 🧪 Linting
119
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
1210
permissions:
1311
contents: read
14-
packages: read
1512
steps:
1613
- name: Checkout
1714
uses: actions/checkout@v4
@@ -23,25 +20,20 @@ jobs:
2320
env:
2421
FILTER_REGEX_INCLUDE: "((/src/main/.*.java)|updateVersion.sh)"
2522
DEFAULT_BRANCH: master
26-
VALIDATE_GOOGLE_JAVA_FORMAT: true
23+
VALIDATE_JAVA: true
2724
VALIDATE_BASH: true
2825
VALIDATE_ALL_CODEBASE: false
2926
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3027

3128
test_matrix:
29+
name: 🧪 Testing
3230
runs-on: ${{ vars.RTLDEV_MW_CI_OS }}
31+
needs: lint
3332
permissions:
34-
contents: write
35-
packages: write
36-
deployments: write
37-
33+
contents: read
3834
strategy:
3935
matrix:
4036
java-version: ${{ fromJson(vars.RTLDEV_MW_CI_JAVA_MATRIX) }}
41-
42-
name: 🧪 Testing
43-
needs: lint
44-
4537
steps:
4638
- name: Checkout
4739
uses: actions/checkout@v4

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
<version>3.6.2</version>
7171
<configuration>
7272
<verbose>true</verbose>
73-
<source>8</source>
7473
<additionalOptions>-html5</additionalOptions>
7574
</configuration>
7675
<executions>
@@ -123,6 +122,11 @@
123122
<artifactId>maven-install-plugin</artifactId>
124123
<version>3.1.1</version>
125124
</plugin>
125+
<plugin>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-project-info-reports-plugin</artifactId>
128+
<version>3.4.5</version> <!-- Use the desired version -->
129+
</plugin>
126130
<plugin>
127131
<groupId>org.apache.maven.plugins</groupId>
128132
<artifactId>maven-release-plugin</artifactId>

0 commit comments

Comments
 (0)