fabric-loom/codenarc.groovy
modmuss50 ff6701e817 Add basic groovy code style validation.
IDK how well this would work on a gradle script but might be interesting to try on yarn or something.
2021-03-25 22:57:28 +00:00

66 lines
1.6 KiB
Groovy

ruleset {
UnnecessarySemicolon
BlockEndsWithBlankLine
BlockStartsWithBlankLine
ConsecutiveBlankLines
MissingBlankLineAfterImports
MissingBlankLineAfterPackage
// Braces
BracesForClass
BracesForForLoop
BracesForIfElse
BracesForMethod
BracesForTryCatchFinally
// Spaces
SpaceAfterCatch
SpaceAfterComma
SpaceAfterClosingBrace
SpaceAfterFor
SpaceAfterIf
SpaceAfterOpeningBrace
SpaceAfterSemicolon
SpaceAfterSwitch
SpaceAfterWhile
SpaceAroundClosureArrow
SpaceAroundMapEntryColon
SpaceAroundOperator
SpaceBeforeClosingBrace
SpaceBeforeOpeningBrace
TrailingWhitespace
// Groovyism - See: https://codenarc.org/codenarc-rules-groovyism.html
ClosureAsLastMethodParameter
ExplicitArrayListInstantiation
ExplicitCallToAndMethod
ExplicitCallToCompareToMethod
ExplicitCallToDivMethod
ExplicitCallToEqualsMethod
ExplicitCallToGetAtMethod
ExplicitCallToLeftShiftMethod
ExplicitCallToMinusMethod
ExplicitCallToMultiplyMethod
ExplicitCallToModMethod
ExplicitCallToOrMethod
ExplicitCallToPlusMethod
ExplicitCallToPowerMethod
ExplicitCallToRightShiftMethod
ExplicitCallToXorMethod
ExplicitHashMapInstantiation
ExplicitLinkedHashMapInstantiation
ExplicitHashSetInstantiation
ExplicitLinkedListInstantiation
ExplicitStackInstantiation
ExplicitTreeSetInstantiation
GetterMethodCouldBeProperty
GStringAsMapKey
GStringExpressionWithinString
CouldBeElvis
TernaryCouldBeElvis
FieldTypeRequired
MethodParameterTypeRequired
//Misc
LongLiteralWithLowerCaseL
}