-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
249 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Checkstyle | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
checkstyle: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
|
||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Apply Checkstyle | ||
run: ./gradlew checkstyleMain checkstyleTest | ||
|
||
- name: Upload Checkstyle reports | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: checkstyle-reports | ||
path: build/reports/checkstyle/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
<?xml version="1.0"?> | ||
<!DOCTYPE module PUBLIC | ||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" | ||
"https://checkstyle.org/dtds/configuration_1_3.dtd"> | ||
|
||
<module name="Checker"> | ||
<module name="SeverityMatchFilter"> | ||
<property name="severity" value="info"/> | ||
<property name="acceptOnMatch" value="false"/> | ||
</module> | ||
|
||
<module name="FileTabCharacter"> | ||
<property name="eachLine" value="true"/> | ||
</module> | ||
|
||
<module name="SuppressionFilter"> | ||
<property name="file" value="${config_loc}/suppress.xml"/> | ||
</module> | ||
|
||
<module name="LineLength"> | ||
<property name="max" value="200"/> | ||
<property name="ignorePattern" value="^[ \t]*\*.*@.*$"/> | ||
</module> | ||
|
||
<module name="TreeWalker"> | ||
<property name="tabWidth" value="4"/> | ||
<property name="severity" value="error"/> | ||
|
||
<module name="ConstantName"/> | ||
|
||
<module name="LocalFinalVariableName"/> | ||
|
||
<module name="LocalVariableName"/> | ||
|
||
<module name="MemberName"> | ||
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/> | ||
</module> | ||
|
||
<module name="MethodName"/> | ||
|
||
<module name="PackageName"/> | ||
|
||
<module name="ParameterName"/> | ||
|
||
<module name="StaticVariableName"/> | ||
|
||
<module name="TypeName"/> | ||
|
||
<module name="AvoidStarImport"/> | ||
<module name="RedundantImport"/> | ||
<module name="UnusedImports"/> | ||
|
||
<module name="EmptyForInitializerPad"/> | ||
|
||
<module name="MethodParamPad"/> | ||
|
||
<module name="NoWhitespaceBefore"/> | ||
|
||
<module name="WhitespaceAfter"> | ||
<property name="tokens" | ||
value="COMMA, SEMI, TYPECAST, LITERAL_IF, LITERAL_ELSE, | ||
LITERAL_WHILE, LITERAL_DO, LITERAL_FOR, DO_WHILE"/> | ||
</module> | ||
|
||
<module name="WhitespaceAround"> | ||
<property name="allowEmptyConstructors" value="true"/> | ||
<property name="allowEmptyLambdas" value="true"/> | ||
<property name="allowEmptyMethods" value="true"/> | ||
<property name="allowEmptyTypes" value="true"/> | ||
<property name="allowEmptyLoops" value="true"/> | ||
<property name="ignoreEnhancedForColon" value="false"/> | ||
<property name="tokens" | ||
value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, | ||
BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAMBDA, LAND, | ||
LCURLY, LE, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, | ||
LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, | ||
LITERAL_TRY, LITERAL_WHILE, 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, LITERAL_ASSERT, TYPE_EXTENSION_AND"/> | ||
<message key="ws.notFollowed" | ||
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/> | ||
<message key="ws.notPreceded" | ||
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/> | ||
</module> | ||
|
||
<module name="OperatorWrap"> | ||
<property name="tokens" value="PLUS, ASSIGN"/> | ||
<property name="option" value="eol"/> | ||
</module> | ||
|
||
<module name="ParenPad"/> | ||
|
||
<module name="TypecastParenPad"/> | ||
|
||
<module name="ModifierOrder"/> | ||
|
||
<module name="RedundantModifier"/> | ||
|
||
<module name="NestedTryDepth"> | ||
<property name="max" value="2"/> | ||
</module> | ||
|
||
<module name="CovariantEquals"/> | ||
|
||
<module name="NeedBraces"> | ||
<property name="tokens" | ||
value="LITERAL_DO, LITERAL_ELSE, LITERAL_FOR, LITERAL_IF, LITERAL_WHILE"/> | ||
</module> | ||
|
||
<module name="LeftCurly"> | ||
<property name="option" value="nl"/> | ||
</module> | ||
|
||
<module name="RightCurly"> | ||
<property name="option" value="alone"/> | ||
</module> | ||
|
||
<module name="EmptyStatement"/> | ||
|
||
<module name="EqualsHashCode"/> | ||
|
||
<module name="DefaultComesLast"/> | ||
|
||
<module name="SimplifyBooleanExpression"/> | ||
|
||
<module name="SimplifyBooleanReturn"/> | ||
|
||
<module name="StringLiteralEquality"/> | ||
|
||
<module name="PackageDeclaration"/> | ||
|
||
<module name="ReturnCount"> | ||
<property name="max" value="3"/> | ||
</module> | ||
|
||
<module name="FallThrough"/> | ||
|
||
<module name="FinalClass"/> | ||
|
||
<module name="MutableException"/> | ||
|
||
<module name="ArrayTypeStyle"/> | ||
|
||
<module name="TodoComment"> | ||
<property name="severity" value="info"/> | ||
<property name="format" value="TODO"/> | ||
</module> | ||
|
||
<module name="UpperEll"/> | ||
|
||
<module name="IllegalType"> | ||
<property name="legalAbstractClassNames" | ||
value="AbstractBeanDefinition, AbstractAccountEvInstruction, AbstractEmsInstruction, AbstractEvInstruction, AbstractEmsAction, AbstractInstrumentAction, AbstractEntry"/> | ||
<property name="illegalClassNames" | ||
value="java.util.GregorianCalendar, java.util.Hashtable, java.util.Vector"/> | ||
</module> | ||
|
||
<module name="DescendantToken"> | ||
<property name="tokens" value="LITERAL_ASSERT"/> | ||
<property name="limitedTokens" | ||
value="ASSIGN,DEC,INC,POST_DEC,POST_INC,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,DIV_ASSIGN,MOD_ASSIGN,BSR_ASSIGN,SR_ASSIGN,SL_ASSIGN,BAND_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN,METHOD_CALL"/> | ||
<property name="maximumNumber" value="2"/> | ||
</module> | ||
|
||
<module name="Regexp"> | ||
<property name="format" value="[ \t]+$"/> | ||
<property name="illegalPattern" value="true"/> | ||
<property name="message" value="Trailing whitespace"/> | ||
</module> | ||
|
||
<module name="FinalParameters"/> | ||
|
||
<module name="JavadocParagraph"/> | ||
<module name="SingleLineJavadoc"/> | ||
<module name="JavadocMethod"> | ||
<property name="accessModifiers" value="public"/> | ||
</module> | ||
<module name="JavadocType"> | ||
<property name="scope" value="public"/> | ||
</module> | ||
<module name="JavadocVariable"> | ||
<property name="scope" value="public"/> | ||
</module> | ||
|
||
<module name="IllegalInstantiation"/> | ||
<module name="MagicNumber"/> | ||
<module name="MissingSwitchDefault"/> | ||
</module> | ||
|
||
<module name="BeforeExecutionExclusionFileFilter"> | ||
<property name="fileNamePattern" value="module\-info\.java$"/> | ||
</module> | ||
</module> |