Skip to content

Commit

Permalink
chore(lint): Update Checkstyle config
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLion committed Sep 13, 2023
1 parent f9d14a8 commit a1aa671
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
43 changes: 33 additions & 10 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
<property name="severity" value="error" />

<!-- Filters -->
<module name="SuppressWithPlainTextCommentFilter"/>
<module name="SuppressWithPlainTextCommentFilter" />
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/suppressions.xml" default="config/checkstyle/suppressions.xml" />
<property name="optional" value="false" />
</module>

<!-- Miscellaneous -->
<module name="NewlineAtEndOfFile" />
Expand All @@ -25,7 +29,7 @@
</module>
<module name="LineLength">
<property name="max" value="120" />
<property name="ignorePattern" value="^package.*|^import.*"/>
<property name="ignorePattern" value="^package.*|^import.*" />
</module>

<!-- Whitespace -->
Expand All @@ -39,42 +43,61 @@
<module name="NeedBraces" />
<module name="RightCurly" />

<!-- Class Design -->
<module name="InnerTypeLast" />
<module name="InterfaceIsType" />
<module name="OneTopLevelClass" />
<module name="VisibilityModifier" />

<!-- Coding -->
<module name="EqualsHashCode" />
<module name="InnerAssignment" />
<module name="OneStatementPerLine" />
<module name="UnnecessaryParentheses" />
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration" />
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration" />
<module name="UnnecessarySemicolonInEnumeration" />
<module name="UnnecessarySemicolonInTryWithResources" />

<!-- Javadoc Comments -->
<module name="InvalidJavadocPosition" />

<!-- Imports -->
<module name="AvoidStarImport" />
<module name="ImportOrder">
<property name="groups" value="/^java\./,javax,com,org"/>
<property name="ordered" value="true"/>
<property name="separated" value="true"/>
<property name="sortStaticImportsAlphabetically" value="true"/>
<property name="option" value="top"/>
<property name="groups" value="/^java\./,javax,org,com" />
<property name="ordered" value="true" />
<property name="separated" value="true" />
<property name="sortStaticImportsAlphabetically" value="true" />
<property name="option" value="top" />
</module>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="RedundantImport" />
<module name="UnusedImports" />

<!-- Miscellaneous -->
<module name="FinalParameters" />
<module name="NoCodeInFile" />
<module name="UpperEll" />

<!-- Modifiers -->
<module name="ModifierOrder"/>
<module name="ModifierOrder" />
<module name="RedundantModifier" />

<!-- Naming Conventions -->
<module name="LocalFinalVariableName" />

<!-- Whitespace -->
<module name="EmptyLineSeparator">
<property name="allowMultipleEmptyLines" value="false" />
</module>
<module name="GenericWhitespace" />
<module name="MethodParamPad" />
<module name="NoLineWrap" />
<module name="NoWhitespaceAfter" />
<module name="NoWhitespaceBefore" />
<module name="NoWhitespaceBeforeCaseDefaultColon" />
<module name="ParenPad" />
<module name="SingleSpaceSeparator" />
<module name="TypecastParenPad" />
<module name="WhitespaceAfter" />
<module name="WhitespaceAround" />
Expand Down
7 changes: 7 additions & 0 deletions config/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC "-//Checkstyle//DTD SuppressionFilter Configuration 1.2//EN" "https://checkstyle.org/dtds/suppressions_1_2.dtd">

<suppressions>
<!-- Tests -->
<suppress checks="InnerTypeLast" files=".*[\\/]src[\\/]test[\\/]" />
</suppressions>

0 comments on commit a1aa671

Please sign in to comment.