Skip to content

Commit d7b7bbf

Browse files
authored
Merge pull request #131 from xdev-software/develop
Release
2 parents 96829bb + 135a27f commit d7b7bbf

File tree

20 files changed

+158
-64
lines changed

20 files changed

+158
-64
lines changed

.config/checkstyle/checkstyle.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<module name="TreeWalker">
5353
<!-- Checks - sorted alphabetically -->
5454
<module name="ArrayTypeStyle"/>
55+
<module name="AvoidDoubleBraceInitialization"/>
5556
<module name="AvoidStarImport"/>
5657
<module name="ConstantName"/>
5758
<module name="DefaultComesLast"/>
@@ -68,6 +69,11 @@
6869
<module name="FinalParameters"/>
6970
<module name="GenericWhitespace"/>
7071
<module name="HideUtilityClassConstructor"/>
72+
<module name="IllegalCatch">
73+
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingnpe -->
74+
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingthrowable -->
75+
<property name="illegalClassNames" value="Error,Throwable,NullPointerException,java.lang.Error,java.lang.Throwable,java.lang.NullPointerException"/>
76+
</module>
7177
<module name="IllegalImport"/>
7278
<module name="InterfaceIsType"/>
7379
<module name="JavadocStyle">
@@ -93,7 +99,6 @@
9399
<module name="MethodParamPad"/>
94100
<module name="MissingDeprecated"/>
95101
<module name="MissingOverride"/>
96-
<module name="MissingSwitchDefault"/>
97102
<module name="ModifierOrder"/>
98103
<module name="NeedBraces"/>
99104
<module name="NoClone"/>
@@ -122,7 +127,13 @@
122127
</module>
123128
<module name="TypecastParenPad"/>
124129
<module name="TypeName"/>
130+
<module name="UnnecessaryParentheses"/>
131+
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
132+
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
133+
<module name="UnnecessarySemicolonInEnumeration"/>
134+
<module name="UnnecessarySemicolonInTryWithResources"/>
125135
<module name="UnusedImports"/>
136+
<module name="UnusedLocalVariable"/>
126137
<module name="UpperEll"/>
127138
<module name="VisibilityModifier">
128139
<property name="packageAllowed" value="true"/>

.config/pmd/ruleset.xml

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,38 @@
1010

1111
<!-- Only rules that don't overlap with CheckStyle! -->
1212

13+
<rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace"/>
14+
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/>
1315
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
16+
<rule ref="category/java/bestpractices.xml/ConstantsInInterface"/>
17+
<rule ref="category/java/bestpractices.xml/ExhaustiveSwitchHasDefault"/>
18+
<rule ref="category/java/bestpractices.xml/LiteralsFirstInComparisons"/>
19+
<!-- CheckStyle can't handle this switch behavior -> delegated to PMD -->
20+
<rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/>
21+
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
22+
<properties>
23+
<property name="strictMode" value="true"/>
24+
</properties>
25+
</rule>
1426
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
27+
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion"/>
28+
<rule ref="category/java/bestpractices.xml/SystemPrintln"/>
29+
<rule ref="category/java/bestpractices.xml/UnusedAssignment"/>
30+
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
31+
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
32+
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
1533
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
34+
<rule ref="category/java/bestpractices.xml/UseEnumCollections"/>
1635
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
36+
<rule ref="category/java/bestpractices.xml/UseTryWithResources"/>
1737

1838
<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
1939
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
2040
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
41+
<rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference"/>
2142
<rule ref="category/java/codestyle.xml/NoPackage"/>
2243
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
44+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>
2345

2446
<rule ref="category/java/design.xml">
2547
<!-- Sometimes abstract classes have just fields -->
@@ -76,9 +98,6 @@
7698

7799
<!-- Limit too low -->
78100
<exclude name="UseObjectForClearerAPI"/>
79-
80-
<!-- Handled by checkstyle -->
81-
<exclude name="UseUtilityClass"/>
82101
</rule>
83102

84103
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
@@ -114,17 +133,33 @@
114133
</properties>
115134
</rule>
116135

136+
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
137+
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
138+
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
117139
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
118140
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
119141
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
120142
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
121143
<rule ref="category/java/errorprone.xml/DontImportSun"/>
144+
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
145+
<rule ref="category/java/errorprone.xml/EqualsNull"/>
146+
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
147+
<rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough"/>
148+
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
149+
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat"/>
150+
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
122151
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
152+
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
153+
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
154+
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
155+
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
156+
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
123157
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
158+
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>
124159

125160

126161
<rule ref="category/java/multithreading.xml">
127-
<!-- Just bloats code -->
162+
<!-- Just bloats code; improved in JEP-491/Java 24+ -->
128163
<exclude name="AvoidSynchronizedAtMethodLevel"/>
129164

130165
<!-- NOPE -->
@@ -151,5 +186,12 @@
151186
<exclude name="UseStringBufferForStringAppends"/>
152187
</rule>
153188

189+
<rule ref="category/java/performance.xml/TooFewBranchesForSwitch">
190+
<properties>
191+
<!-- If you have one case only please use a if -->
192+
<property name="minimumNumberCaseForASwitch" value="2"/>
193+
</properties>
194+
</rule>
195+
154196
<rule ref="category/java/security.xml"/>
155197
</ruleset>

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: 🐞 Bug
22
description: Create a bug report for something that is broken
33
labels: [bug]
4+
type: bug
45
body:
56
- type: markdown
67
attributes:

.github/ISSUE_TEMPLATE/enhancement.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: ✨ Feature/Enhancement
22
description: Suggest a new feature or enhancement
33
labels: [enhancement]
4+
type: feature
45
body:
56
- type: markdown
67
attributes:

.github/workflows/broken-links.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ permissions:
1111
jobs:
1212
link-checker:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 15
1415
steps:
1516
- uses: actions/checkout@v4
1617

1718
- run: mv .github/.lycheeignore .lycheeignore
1819

1920
- name: Link Checker
2021
id: lychee
21-
uses: lycheeverse/lychee-action@v2
22+
uses: lycheeverse/lychee-action@82202e5e9c2f4ef1a55a3d02563e1cb6041e5332 # v2
23+
with:
24+
fail: false # Don't fail on broken links, create an issue instead
2225

2326
- name: Find already existing issue
2427
id: find-issue
@@ -35,7 +38,7 @@ jobs:
3538

3639
- name: Create Issue From File
3740
if: env.lychee_exit_code != 0
38-
uses: peter-evans/create-issue-from-file@v5
41+
uses: peter-evans/create-issue-from-file@e8ef132d6df98ed982188e460ebb3b5d4ef3a9cd # v5
3942
with:
4043
issue-number: ${{ steps.find-issue.outputs.number }}
4144
title: Link Checker Report

.github/workflows/check-build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
jobs:
2727
build:
2828
runs-on: ubuntu-latest
29+
timeout-minutes: 30
2930

3031
strategy:
3132
matrix:
@@ -66,6 +67,7 @@ jobs:
6667
checkstyle:
6768
runs-on: ubuntu-latest
6869
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
70+
timeout-minutes: 15
6971

7072
strategy:
7173
matrix:
@@ -88,6 +90,7 @@ jobs:
8890
pmd:
8991
runs-on: ubuntu-latest
9092
if: ${{ github.event_name != 'pull_request' || !startsWith(github.head_ref, 'renovate/') }}
93+
timeout-minutes: 15
9194

9295
strategy:
9396
matrix:
@@ -117,7 +120,4 @@ jobs:
117120
name: pmd-report
118121
if-no-files-found: ignore
119122
path: |
120-
target/site/*.html
121-
target/site/css/**
122-
target/site/images/logos/maven-feather.png
123-
target/site/images/external.png
123+
target/reports/**

.github/workflows/release.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ permissions:
1414
jobs:
1515
check-code:
1616
runs-on: ubuntu-latest
17+
timeout-minutes: 30
1718
steps:
1819
- uses: actions/checkout@v4
1920

@@ -25,7 +26,7 @@ jobs:
2526
cache: 'maven'
2627

2728
- name: Build with Maven
28-
run: ./mvnw -B clean package
29+
run: ./mvnw -B clean package -T2C
2930

3031
- name: Check for uncommited changes
3132
run: |
@@ -48,6 +49,7 @@ jobs:
4849
prepare-release:
4950
runs-on: ubuntu-latest
5051
needs: [check-code]
52+
timeout-minutes: 10
5153
outputs:
5254
upload_url: ${{ steps.create_release.outputs.upload_url }}
5355
steps:
@@ -62,7 +64,7 @@ jobs:
6264
run: |
6365
mvnwPath=$(readlink -f ./mvnw)
6466
modules=("") # root
65-
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
67+
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
6668
for i in "${modules[@]}"
6769
do
6870
echo "Processing $i/pom.xml"
@@ -87,7 +89,7 @@ jobs:
8789
8890
- name: Create Release
8991
id: create_release
90-
uses: shogo82148/actions-create-release@v1
92+
uses: shogo82148/actions-create-release@e5f206451d4ace2da9916d01f1aef279997f8659 # v1
9193
with:
9294
tag_name: v${{ steps.version.outputs.release }}
9395
release_name: v${{ steps.version.outputs.release }}
@@ -109,6 +111,7 @@ jobs:
109111
publish-maven:
110112
runs-on: ubuntu-latest
111113
needs: [prepare-release]
114+
timeout-minutes: 60
112115
steps:
113116
- uses: actions/checkout@v4
114117

@@ -118,7 +121,7 @@ jobs:
118121
git config --global user.name "GitHub Actions"
119122
git pull
120123
121-
- name: Set up JDK Apache Maven Central
124+
- name: Set up JDK OSSRH
122125
uses: actions/setup-java@v4
123126
with: # running setup-java again overwrites the settings.xml
124127
java-version: '17'
@@ -129,7 +132,7 @@ jobs:
129132
gpg-passphrase: MAVEN_GPG_PASSPHRASE
130133
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
131134

132-
- name: Publish to Apache Maven Central
135+
- name: Publish to OSSRH
133136
run: ../mvnw -B deploy -Possrh -DskipTests
134137
env:
135138
MAVEN_CENTRAL_USERNAME: ${{ secrets.S01_OSS_SONATYPE_MAVEN_USERNAME }}
@@ -140,6 +143,7 @@ jobs:
140143
publish-pages:
141144
runs-on: ubuntu-latest
142145
needs: [prepare-release]
146+
timeout-minutes: 15
143147
steps:
144148
- uses: actions/checkout@v4
145149

@@ -161,14 +165,16 @@ jobs:
161165
working-directory: ${{ env.PRIMARY_MAVEN_MODULE }}
162166

163167
- name: Deploy to Github pages
164-
uses: peaceiris/actions-gh-pages@v4
168+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
165169
with:
166170
github_token: ${{ secrets.GITHUB_TOKEN }}
167171
publish_dir: ./${{ env.PRIMARY_MAVEN_MODULE }}/target/site
172+
force_orphan: true
168173

169174
after-release:
170175
runs-on: ubuntu-latest
171176
needs: [publish-maven]
177+
timeout-minutes: 10
172178
steps:
173179
- uses: actions/checkout@v4
174180

@@ -182,7 +188,7 @@ jobs:
182188
run: |
183189
mvnwPath=$(readlink -f ./mvnw)
184190
modules=("") # root
185-
modules+=($(grep -ozP '(?<=module>)[^<]+' 'pom.xml' | tr -d '\0'))
191+
modules+=($(grep -oP '(?<=<module>)[^<]+' 'pom.xml'))
186192
for i in "${modules[@]}"
187193
do
188194
echo "Processing $i/pom.xml"

.github/workflows/sonar.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
token-check:
2828
runs-on: ubuntu-latest
2929
if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) }}
30+
timeout-minutes: 5
3031
outputs:
3132
hasToken: ${{ steps.check-token.outputs.has }}
3233
steps:
@@ -40,6 +41,7 @@ jobs:
4041
runs-on: ubuntu-latest
4142
needs: token-check
4243
if: ${{ needs.token-check.outputs.hasToken }}
44+
timeout-minutes: 30
4345
steps:
4446
- uses: actions/checkout@v4
4547
with:

.github/workflows/sync-labels.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ permissions:
1414
jobs:
1515
labels:
1616
runs-on: ubuntu-latest
17+
timeout-minutes: 10
1718
steps:
1819
- uses: actions/checkout@v4
1920
with:
2021
sparse-checkout: .github/labels.yml
2122

22-
- uses: EndBug/label-sync@v2
23+
- uses: EndBug/label-sync@52074158190acb45f3077f9099fea818aa43f97a # v2
2324
with:
2425
config-file: .github/labels.yml

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ env:
99
jobs:
1010
publish-maven:
1111
runs-on: ubuntu-latest
12+
timeout-minutes: 60
1213
steps:
1314
- uses: actions/checkout@v4
1415

.github/workflows/update-from-template.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ permissions:
3131
jobs:
3232
update:
3333
runs-on: ubuntu-latest
34+
timeout-minutes: 60
3435
outputs:
3536
update_branch_merged_commit: ${{ steps.manage-branches.outputs.update_branch_merged_commit }}
3637
create_update_branch_merged_pr: ${{ steps.manage-branches.outputs.create_update_branch_merged_pr }}
@@ -180,6 +181,7 @@ jobs:
180181
needs: [update]
181182
if: needs.update.outputs.create_update_branch_merged_pr == 1
182183
runs-on: ubuntu-latest
184+
timeout-minutes: 60
183185
steps:
184186
- uses: actions/checkout@v4
185187
with:
@@ -200,7 +202,7 @@ jobs:
200202
GH_TOKEN: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
201203
run: |
202204
not_failed_conclusion="skipped|neutral|success"
203-
not_relevant_app_slug="dependabot|github-pages|sonarcloud"
205+
not_relevant_app_slug="dependabot|github-pages|sonarqubecloud"
204206
205207
echo "Waiting for checks to start..."
206208
sleep 40s
@@ -210,7 +212,7 @@ jobs:
210212
211213
echo "Checking if update-branch-merged exists"
212214
git fetch
213-
if [[ $(git rev-parse origin/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
215+
if [[ $(git ls-remote --heads origin refs/heads/${{ env.UPDATE_BRANCH_MERGED }}) ]]; then
214216
echo "Branch still exists; Continuing..."
215217
else
216218
echo "Branch origin/${{ env.UPDATE_BRANCH_MERGED }} is missing"

0 commit comments

Comments
 (0)