GeezerVison is showing github.com — [internal] Replacing Checkstyle with Spotless · pmd/pmd · Discussion #7302
[internal] Replacing Checkstyle with Spotless
#7302
Discussion options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
It might make sense to let Spotless take over some of the responsibilities of Checkstyle. Then maybe the remaining rules could be checked by PMD itself. This was discussed in #5875, but that discussion left some questions unanswered.
Can we remove checkstyle? Are there any things that we use in checkstyle and that are not supported by spotless?
The currently used rules are categorized below:
Current Checkstyle rules used by PMD
Not covered by either PMD or Spotless
- HiddenField
- PackageAnnotation
- JavadocPackage
- BooleanExpressionComplexity
- AbbreviationAsWordInName
- TodoComment
- ArrayTrailingComma (Spotless will add a line break after trailing comma, but not force a comma if there is a line break before
})
- Javadoc parsing
- MissingDeprecated
- NonEmptyAtclauseDescription
- SummaryJavadoc
- AtclauseOrder
- JavadocParagraph
Partiallly covered by PMD
- DeclarationOrder: FieldDeclarationsShouldBeAtStartOfClass
- MagicNumber: AvoidLiteralsInIfCondition
- AnnotationUseStyle: UnnecessaryAnnotationValueElement
- ReturnCount: OnlyOneReturn
Covered by PMD
- MissingOverride: MissingOverride
- JavadocMethod: CommentRequired
- JavadocType: CommentRequired
- JavadocVariable: CommentRequired
- AvoidStarImport: OnDemandImport
- IllegalImport: XPath rule
- UnusedImports: UnneccessaryImport
- RedundantImport: UnneccessaryImport
- MemberName: FieldNamingConventions
- MethodName: MethodNamingConventions
- PackageName: PackageCase
- ParameterName: FormalParameterNamingConventions
- StaticVariableName: FieldNamingConventions
- TypeName: TypeNamingConvention
- ClassTypeParameterName: TypeParameterNamingConventions
- MethodTypeParameterName: TypeParameterNamingConventions
- InterfaceTypeParameterName: TypeParameterNamingConventions
- IllegalCatch: AvoidCatchingGenericException
- IllegalThrows: AvoidThrowingRawExceptionTypes (not configurable)
- ParameterAssignment: AvoidReassigningParameters
- SimplifyBooleanExpression: SimplifyBooleanExpressions + SimplifiedTernary
- SimplifyBooleanReturn: SimplifyBooleanReturns
- EmptyBlock: EmptyControlStatement
- EmptyCatchBlock: EmptyCatchBlock
- UpperEll: LongLiteralEndingWithLowercaseL
- OuterTypeFilename: TypeNameMismatch
- StringLiteralEquality: UseEqualsToCompareStrings
- ArrayTypeStyle: CStyleArrayDeclaration
- UnnecessaryParentheses: UselessParentheses
- OneTopLevelClass: TypeNameMismatch (implied)
- DefaultComesLast: DefaultLabelNotLastInSwitch
- PackageDeclaration: NoPackage + TypeNameMismatch
- FallThrough: ImplicitSwitchFallThrough
- EqualsHashCode: OverrideBothEqualsAndHashcode
- ConstantName: FieldNamingConventions
- LocalVariableName: LocalVariableNamingConventions
- EmptyStatement: UnnecessarySemicolon
- RedundantModifier: UnnecessaryModifier
- NeedBraces: ControlStatementBraces
- ModifierOrder: ModifierOrder
- HideUtilityClassConstructor: InstantiableUtilityClass
- InterfaceIsType: ConstantsInInterface (via ignoreIfHasMethods property)
- MultipleStringLiterals: AvoidDuplicateLiterals
- EqualsAvoidNull: LiteralsFirstInComparisons
- ModifiedControlVariable: AvoidReassigningLoopVariables
- InnerAssignment: AssignmentInOperand
- MultipleVariableDeclarations: OneDeclarationPerLine
- AnnotationLocation: ModifierOrder (via typeAnnotations property)
Covered by Spotless
- Whitespace
- JavadocTagContinuationIndentation
- GenericWhitespace
- EmptyForInitializerPad
- EmptyForIteratorPad
- NoWhitespaceAfter
- NoWhitespaceBefore
- OperatorWrap
- MethodParamPad
- ParenPad
- TypecastParenPad
- WhitespaceAfter
- WhitespaceAround
- LeftCurly
- FileTabCharacter
- NewlineAtEndOfFile
- EmptyLineSeparator
- Indentation
- SeparatorWrap
- SingleSpaceSeparator
- OneStatementPerLine
- CommentsIndentation
- RightCurly
- ImportOrder
- RegexpHeader
The upside of using Spotless is the possibility to automatically fix the issues it detects.
|
You must be logged in to vote