Skip to content

Commit

Permalink
exclude avro sources from checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
kjozsa committed Oct 4, 2024
1 parent d6d4ef5 commit 1dddec9
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 94 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ configure(project.fineractJavaProjects) {
"-Xlint:overloads",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:processing",
"-Xlint:-processing",
"-Xlint:removal",
"-Xlint:requires-automatic",
"-Xlint:requires-transitive-automatic",
Expand Down
186 changes: 93 additions & 93 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
-->
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>
Expand Down Expand Up @@ -50,21 +50,21 @@


<module name="TreeWalker">
<module name="ParameterName">
<module name="ParameterName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$|[a-z]"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SeparatorWrap">
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SeparatorWrap">
<property name="tokens" value="DOT"/>
<property name="option" value="nl"/>
</module>
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidHidingCauseExceptionCheck" />
<module name="SuppressWarningsHolder" />
<module name="RegexpSinglelineJava">
</module>
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidHidingCauseExceptionCheck"/>
<module name="SuppressWarningsHolder"/>
<module name="RegexpSinglelineJava">
<property name="format" value="System\.(out)|(err)\.print(ln)?\("/>
<property name="message" value="Line contains console output."/>
<property name="ignoreComments" value="false" />
<property name="ignoreComments" value="false"/>
</module>
<module name="EqualsHashCode"/>
<module name="FinalClass"/>
Expand All @@ -74,12 +74,12 @@
</module>
<module name="NoFinalizer"/>
<module name="FallThrough"/>
<module name="IllegalThrows" />
<module name="IllegalThrows"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="AvoidStarImport"/>
<module name="LeftCurly" />
<module name="AnnotationLocation">
<module name="LeftCurly"/>
<module name="AnnotationLocation">
<property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
</module>
<module name="CustomImportOrder">
Expand All @@ -96,29 +96,29 @@
<property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, STATIC_INIT, INSTANCE_INIT"/>
</module>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCertainImportsCheck">
<property name="packageNameRegexp" value=".*" />
<property name="forbiddenImportsRegexp" value="com.google.common.base.Charsets" />
<property name="forbiddenImportsExcludesRegexp" value="" />
<message key="forbid.certain.imports" value="Use ''java.nio.charset.StandardCharsets'' instead of ''{0}''" />
<property name="packageNameRegexp" value=".*"/>
<property name="forbiddenImportsRegexp" value="com.google.common.base.Charsets"/>
<property name="forbiddenImportsExcludesRegexp" value=""/>
<message key="forbid.certain.imports" value="Use ''java.nio.charset.StandardCharsets'' instead of ''{0}''"/>
</module>
<module name="OneStatementPerLine"/>
<module name="EmptyStatement"/>
<module name="EmptyCatchBlock">
<module name="OneStatementPerLine"/>
<module name="EmptyStatement"/>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignore"/>
</module>
<module name="RegexpSinglelineJava">
<module name="RegexpSinglelineJava">
<property name="format" value="\.printStackTrace?\("/>
<property name="message" value="Line contains printStacktrace()."/>
<property name="ignoreComments" value="false" />
</module>
<property name="ignoreComments" value="false"/>
</module>
<module name="TypeName">
<message key="name.invalidPattern"
value="Type name ''{0}'' must match pattern ''{1}''."/>
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodTypeParameterName">
<module name="MethodTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Method type name ''{0}'' must match pattern ''{1}''."/>
value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="EmptyLineSeparator">
<property name="allowNoEmptyLineBetweenFields" value="true"/>
Expand All @@ -129,14 +129,14 @@
<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9_]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="OuterTypeFilename"/>
<module name="AnnotationLocation">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="AvoidEscapedUnicodeCharacters">
<module name="AvoidEscapedUnicodeCharacters">
<property name="allowEscapesForControlCharacters" value="true"/>
<property name="allowByTailComment" value="true"/>
<property name="allowNonPrintableEscapes" value="true"/>
Expand All @@ -145,78 +145,78 @@
<property name="option" value="TEXT"/>
<property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
</module>
<module name="UpperEll"/>
<module name="NeedBraces"/>
<module name="MethodParamPad"/>
<module name="ArrayTypeStyle"/>
<module name="NoLineWrap"/>
<module name="IllegalTokenText">
<module name="UpperEll"/>
<module name="NeedBraces"/>
<module name="MethodParamPad"/>
<module name="ArrayTypeStyle"/>
<module name="NoLineWrap"/>
<module name="IllegalTokenText">
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
<property name="format" value="\\u00(08|09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
<property name="message" value="Avoid using corresponding octal or Unicode escape."/>
</module>
<module name="GenericWhitespace">
<module name="GenericWhitespace">
<message key="ws.followed"
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
<message key="ws.preceded"
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
<message key="ws.illegalFollow"
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
<message key="ws.notPreceded"
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
</module>
<module name="HideUtilityClassConstructor"/>
<module name="OneTopLevelClass"/>
<module name="OneTopLevelClass"/>
<module name="MethodName">
<property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ClassTypeParameterName">
<module name="ClassTypeParameterName">
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern"
value="Class type name ''{0}'' must match pattern ''{1}''."/>
value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MutableException"/>
<module name="WhitespaceAround">
<module name="MutableException"/>
<module name="WhitespaceAround">
<property name="allowEmptyConstructors" value="true"/>
<property name="allowEmptyMethods" value="true"/>
<property name="allowEmptyTypes" value="true"/>
<property name="allowEmptyLoops" value="true"/>
<message key="ws.notFollowed"
value="WhitespaceAround: ''{0}'' is not followed by whitespace."/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
value="WhitespaceAround: ''{0}'' is not followed by whitespace."/>
<message key="ws.notPreceded"
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
</module>
<module name="MemberName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="RedundantModifier"/>
<module name="ParenPad" />
<module name="ParenPad"/>
<module name="ModifierOrder"/>
<module name="LocalVariableName">
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$|[a-z]"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="AvoidNoArgumentSuperConstructorCall"/>
<module name="AvoidDoubleBraceInitialization"/>
<!-- TODO Enable many more checks (go about this one by one, step by step, raise separate PRs fixing and then enforcing):
<!-- TODO Enable many more checks (go about this one by one, step by step, raise separate PRs fixing and then enforcing):
<module name="HiddenField">
<property name="ignoreAbstractMethods" value="true" />
<property name="ignoreConstructorParameter" value="true" />
<property name="ignoreSetter" value="true" />
<property name="setterCanReturnItsClass" value="true" />
</module>
<module name="HiddenField">
<property name="ignoreAbstractMethods" value="true" />
<property name="ignoreConstructorParameter" value="true" />
<property name="ignoreSetter" value="true" />
<property name="setterCanReturnItsClass" value="true" />
</module>
< ! - - TODO Checks for Exception Handling Anti-Patterns - - >
<module name="IllegalCatch"/>
< ! - - TODO Checks for Exception Handling Anti-Patterns - - >
<module name="IllegalCatch"/>
Expand Down Expand Up @@ -244,38 +244,38 @@
<module name="ConstantName" />
<module name="ConstantName" />
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="4"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="4"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<! - - Enable some JavaDoc validation (requires quite a lot of manual clean up work; not a top priority for initial Checkstyle adoption - ->
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadocCheck">
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocStyle">
< ! - - Do NOT 'scope' this one; any JavaDoc (public/protected/private) IFF present, should be style checked. - - >
<property name="checkEmptyJavadoc" value="true" />
<property name="tokens" value="ANNOTATION_DEF, ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, VARIABLE_DEF"/>
</module>
<module name="SingleLineJavadoc"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
< ! - - TODO Enable proper JavaDoc paragraphs (requires removing /** from all license headers) - - >
<module name="JavadocParagraph">
<property name="allowNewlineParagraph" value="false"/>
</module>
-->
<! - - Enable some JavaDoc validation (requires quite a lot of manual clean up work; not a top priority for initial Checkstyle adoption - ->
<module name="JavadocTagContinuationIndentation"/>
<module name="SummaryJavadocCheck">
<property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocStyle">
< ! - - Do NOT 'scope' this one; any JavaDoc (public/protected/private) IFF present, should be style checked. - - >
<property name="checkEmptyJavadoc" value="true" />
<property name="tokens" value="ANNOTATION_DEF, ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, VARIABLE_DEF"/>
</module>
<module name="SingleLineJavadoc"/>
<module name="NonEmptyAtclauseDescription"/>
<module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
< ! - - TODO Enable proper JavaDoc paragraphs (requires removing /** from all license headers) - - >
<module name="JavadocParagraph">
<property name="allowNewlineParagraph" value="false"/>
</module>
-->
</module>
<!-- NB, PS: This entire custom Checkstyle configuration originally came from (EPL'd)
https://github.com/opendaylight/odlparent/blob/master/checkstyle/src/main/resources/odl_checks.xml
Expand Down
4 changes: 4 additions & 0 deletions fineract-avro-schemas/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ spotless {
}
}

tasks.withType<Checkstyle> {
exclude("**")
}

tasks.named("compileJava") {
dependsOn("preprocessAvroSchemas", "generateAvroJava", "spotlessJsonApply")
}
Expand Down

0 comments on commit 1dddec9

Please sign in to comment.