Skip to content

Commit 8f154b7

Browse files
committed
Merge branch 'master' into update-from-template-merged
2 parents 888b4ce + 7e9fd4e commit 8f154b7

File tree

11 files changed

+463
-1
lines changed

11 files changed

+463
-1
lines changed

.config/checkstyle/checkstyle.xml

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN"
3+
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
4+
<module name="Checker">
5+
<!-- Only check code -->
6+
<property name="fileExtensions" value="java"/>
7+
<property name="severity" value="error"/>
8+
9+
<property name="tabWidth" value="4"/>
10+
11+
<module name="SuppressionFilter">
12+
<property name="file" value=".config/checkstyle/suppressions.xml"/>
13+
</module>
14+
15+
<module name="FileLength"/>
16+
<module name="LineLength">
17+
<property name="max" value="120"/>
18+
<property name="fileExtensions" value="java"/>
19+
<!-- Ignore default + links -->
20+
<property name="ignorePattern" value="(^(package|import))|(^\s*(\/\/|\*) .*https?.*$)"/>
21+
</module>
22+
<module name="NewlineAtEndOfFile"/>
23+
24+
<module name="RegexpSingleline">
25+
<!-- Ignore inside block comments (*) -->
26+
<property name="format" value="[^\s\*][\s]{1,}$"/>
27+
<property name="minimum" value="0"/>
28+
<property name="maximum" value="0"/>
29+
<property name="message" value="Line has trailing whitespaces"/>
30+
</module>
31+
32+
<!-- Generated code -->
33+
<module name="SuppressionSingleFilter">
34+
<property name="checks" value="."/>
35+
<property name="files" value="[\\/]src[\\/]gen(erated)?[\\/].*\.java$"/>
36+
</module>
37+
<!-- Test code -->
38+
<module name="SuppressionSingleFilter">
39+
<property name="checks" value="MagicNumberCheck"/>
40+
<property name="files" value="[\\/]test[\\/].*\.java$"/>
41+
</module>
42+
43+
<!-- Suppressions -->
44+
<module name="SuppressWarningsFilter"/>
45+
<!-- https://github.com/checkstyle/checkstyle/issues/7287 -->
46+
<module name="SuppressWithPlainTextCommentFilter">
47+
<property name="offCommentFormat" value="// CHECKSTYLE\:OFF ([\w\|]+)"/>
48+
<property name="onCommentFormat" value="// CHECKSTYLE\:ON ([\w\|]+)"/>
49+
<property name="checkFormat" value="$1"/>
50+
</module>
51+
52+
<module name="TreeWalker">
53+
<!-- Checks - sorted alphabetically -->
54+
<module name="ArrayTypeStyle"/>
55+
<module name="AvoidStarImport"/>
56+
<module name="ConstantName"/>
57+
<module name="DefaultComesLast"/>
58+
<module name="EmptyBlock"/>
59+
<module name="EmptyCatchBlock"/>
60+
<module name="EmptyForInitializerPad"/>
61+
<module name="EmptyForIteratorPad"/>
62+
<module name="EmptyStatement"/>
63+
<module name="EqualsHashCode"/>
64+
<module name="ExplicitInitialization">
65+
<property name="severity" value="info"/>
66+
</module>
67+
<module name="FinalClass"/>
68+
<module name="FinalParameters"/>
69+
<module name="GenericWhitespace"/>
70+
<module name="HideUtilityClassConstructor"/>
71+
<module name="IllegalImport"/>
72+
<module name="InterfaceIsType"/>
73+
<module name="JavadocStyle">
74+
<property name="checkFirstSentence" value="false"/>
75+
</module>
76+
<module name="LeftCurly">
77+
<!-- Default minus Lambda -->
78+
<property name="tokens" value="ANNOTATION_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, LITERAL_CASE, LITERAL_CATCH, LITERAL_DEFAULT, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, METHOD_DEF, OBJBLOCK, STATIC_INIT, RECORD_DEF, COMPACT_CTOR_DEF"/>
79+
<property name="option" value="nl"/>
80+
</module>
81+
<module name="LocalFinalVariableName"/>
82+
<module name="LocalVariableName"/>
83+
<module name="MagicNumber">
84+
<property name="ignoreAnnotation" value="true"/>
85+
<property name="ignoreFieldDeclaration" value="true"/>
86+
<property name="ignoreHashCodeMethod" value="true"/>
87+
<!-- Defaults + other common constant values (e.g. time) -->
88+
<property name="ignoreNumbers" value="-1, 0, 1, 2, 3, 4, 5, 10, 12, 24, 31, 60, 100, 1000"/>
89+
</module>
90+
<module name="MemberName"/>
91+
<module name="MethodLength"/>
92+
<module name="MethodName"/>
93+
<module name="MethodParamPad"/>
94+
<module name="MissingDeprecated"/>
95+
<module name="MissingOverride"/>
96+
<module name="MissingSwitchDefault"/>
97+
<module name="ModifierOrder"/>
98+
<module name="NeedBraces"/>
99+
<module name="NoClone"/>
100+
<module name="NoFinalizer"/>
101+
<module name="NonEmptyAtclauseDescription"/>
102+
<module name="NoWhitespaceAfter"/>
103+
<module name="NoWhitespaceBefore"/>
104+
<module name="OneStatementPerLine"/>
105+
<module name="OneTopLevelClass"/>
106+
<module name="OperatorWrap"/>
107+
<module name="OuterTypeNumber"/>
108+
<module name="PackageName"/>
109+
<module name="ParameterName"/>
110+
<module name="ParenPad"/>
111+
<module name="RedundantImport"/>
112+
<module name="RequireThis"/>
113+
<module name="RightCurly">
114+
<property name="option" value="alone"/>
115+
</module>
116+
<module name="SimplifyBooleanExpression"/>
117+
<module name="StaticVariableName"/>
118+
<module name="StringLiteralEquality"/>
119+
<module name="SuppressWarningsHolder"/>
120+
<module name="TodoComment">
121+
<property name="severity" value="info"/>
122+
</module>
123+
<module name="TypecastParenPad"/>
124+
<module name="TypeName"/>
125+
<module name="UnusedImports"/>
126+
<module name="UpperEll"/>
127+
<module name="VisibilityModifier">
128+
<property name="packageAllowed" value="true"/>
129+
<property name="protectedAllowed" value="true"/>
130+
</module>
131+
<module name="WhitespaceAfter">
132+
<property name="tokens" value="COMMA,SEMI"/>
133+
</module>
134+
<module name="WhitespaceAround">
135+
<property name="tokens"
136+
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
137+
</module>
138+
</module>
139+
</module>

.config/checkstyle/suppressions.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE suppressions PUBLIC
3+
"-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN"
4+
"https://checkstyle.org/dtds/suppressions_1_2.dtd">
5+
<suppressions>
6+
</suppressions>

.config/pmd/ruleset.xml

+162
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Default"
3+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6+
7+
<description>
8+
This ruleset checks the code for discouraged programming constructs.
9+
</description>
10+
11+
<!-- Only rules that don't overlap with CheckStyle! -->
12+
13+
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
14+
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
15+
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
16+
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
17+
18+
<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
19+
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
20+
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
21+
<rule ref="category/java/codestyle.xml/NoPackage"/>
22+
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
23+
24+
<rule ref="category/java/design.xml">
25+
<!-- Sometimes abstract classes have just fields -->
26+
<exclude name="AbstractClassWithoutAnyMethod"/>
27+
28+
<!-- Using RuntimeExceptions is ok -->
29+
<exclude name="AvoidCatchingGenericException"/>
30+
<exclude name="AvoidThrowingRawExceptionTypes"/>
31+
32+
<!-- Limit too low -->
33+
<exclude name="AvoidDeeplyNestedIfStmts"/>
34+
35+
<!-- Limit too low -->
36+
<exclude name="CouplingBetweenObjects"/>
37+
38+
<!-- Limit too low -->
39+
<exclude name="CyclomaticComplexity"/>
40+
41+
<!-- Makes entity classes impossible -->
42+
<exclude name="DataClass"/>
43+
44+
<!-- Used commonly particular in bigger methods with upstream throws -->
45+
<exclude name="ExceptionAsFlowControl"/>
46+
47+
<!-- Limit too low -->
48+
<exclude name="ExcessiveImports"/>
49+
50+
<!-- Handled by TooManyFields/TooManyMethods -->
51+
<exclude name="ExcessivePublicCount"/>
52+
53+
<!-- Prohibits accessing members using multiple depths -->
54+
<exclude name="LawOfDemeter"/>
55+
56+
<!-- No effect -->
57+
<exclude name="LoosePackageCoupling"/>
58+
59+
<!-- Prohibits singleton pattern -->
60+
<exclude name="MutableStaticState"/>
61+
62+
<!-- Checks LoC, already handled by Checkstyle -->
63+
<exclude name="NcssCount"/>
64+
65+
<!-- Some override methods or Junit require this -->
66+
<exclude name="SignatureDeclareThrowsException"/>
67+
68+
<!-- Reports FP for equals methods -->
69+
<exclude name="SimplifyBooleanReturns"/>
70+
71+
<!-- Limit too low -->
72+
<exclude name="TooManyFields"/>
73+
74+
<!-- Limit too low -->
75+
<exclude name="TooManyMethods"/>
76+
77+
<!-- Limit too low -->
78+
<exclude name="UseObjectForClearerAPI"/>
79+
80+
<!-- Handled by checkstyle -->
81+
<exclude name="UseUtilityClass"/>
82+
</rule>
83+
84+
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
85+
<properties>
86+
<property name="problemDepth" value="4"/>
87+
</properties>
88+
</rule>
89+
<rule ref="category/java/design.xml/CouplingBetweenObjects">
90+
<properties>
91+
<property name="threshold" value="100"/>
92+
</properties>
93+
</rule>
94+
<rule ref="category/java/design.xml/CyclomaticComplexity">
95+
<properties>
96+
<property name="classReportLevel" value="150"/>
97+
<property name="methodReportLevel" value="25"/>
98+
<property name="cycloOptions" value=""/>
99+
</properties>
100+
</rule>
101+
<rule ref="category/java/design.xml/ExcessiveImports">
102+
<properties>
103+
<property name="minimum" value="200"/>
104+
</properties>
105+
</rule>
106+
<rule ref="category/java/design.xml/TooManyFields">
107+
<properties>
108+
<property name="maxfields" value="50"/>
109+
</properties>
110+
</rule>
111+
<rule ref="category/java/design.xml/TooManyMethods">
112+
<properties>
113+
<property name="maxmethods" value="100"/>
114+
</properties>
115+
</rule>
116+
117+
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
118+
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
119+
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
120+
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
121+
<rule ref="category/java/errorprone.xml/DontImportSun"/>
122+
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
123+
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
124+
125+
126+
<rule ref="category/java/multithreading.xml">
127+
<!-- Just bloats code -->
128+
<exclude name="AvoidSynchronizedAtMethodLevel"/>
129+
130+
<!-- NOPE -->
131+
<exclude name="DoNotUseThreads"/>
132+
133+
<!-- Doesn't detect nested thread safe singleton pattern -->
134+
<exclude name="NonThreadSafeSingleton"/>
135+
136+
<!-- Should relevant for fields that use multithreading which is rare -->
137+
<exclude name="UseConcurrentHashMap"/>
138+
</rule>
139+
140+
<rule ref="category/java/performance.xml">
141+
<!-- This was fixed in Java 10 -->
142+
<exclude name="AvoidFileStream"/>
143+
144+
<!-- Used everywhere and has neglectable performance impact -->
145+
<exclude name="AvoidInstantiatingObjectsInLoops"/>
146+
147+
<!-- Handled by checkstyle -->
148+
<exclude name="RedundantFieldInitializer"/>
149+
150+
<!-- Nowadays optimized by compiler; No code bloating needed -->
151+
<exclude name="UseStringBufferForStringAppends"/>
152+
</rule>
153+
154+
<rule ref="category/java/performance.xml/TooFewBranchesForSwitch">
155+
<properties>
156+
<!-- If you have one case only please use a if -->
157+
<property name="minimumNumberCaseForASwitch" value="2"/>
158+
</properties>
159+
</rule>
160+
161+
<rule ref="category/java/security.xml"/>
162+
</ruleset>

.github/workflows/broken-links.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
link-checker:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 15
1415
steps:
1516
- uses: actions/checkout@v4
1617

.github/workflows/sync-labels.yml

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ permissions:
1414
jobs:
1515
labels:
1616
runs-on: ubuntu-latest
17+
timeout-minutes: 10
1718
steps:
1819
- uses: actions/checkout@v4
1920
with:

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
env:
2222
UPDATE_BRANCH: update-from-template
2323
UPDATE_BRANCH_MERGED: update-from-template-merged
24-
REMOTE_URL: https://github.com/xdev-software/base-template.git
24+
REMOTE_URL: https://github.com/xdev-software/java-template.git
2525
REMOTE_BRANCH: master
2626

2727
permissions:
@@ -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:

.idea/checkstyle-idea.xml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)