Skip to content

Create tests from xdoc examples #13100

@stoyanK7

Description

@stoyanK7

For example,
Screenshot from 2023-05-21 16-09-17
should turn into

/*xml
<module name="Checker">
  <module name="TreeWalker">
    <module name="AbstractClassName"/>
  </module>
</module>


*/

package com.puppycrawl.tools.checkstyle.checks.naming.abstractclassname;

// xdoc section -- start
class Test1{
  abstract class AbstractFirstClass {} // OK
  abstract class SecondClass {} // violation
  class AbstractThirdClass {} // violation
  class FourthClass {} // OK
}
// xdoc section -- end

Edit: As time progressed since this issue was created, a few things changed. Example configurations should be in XML (as shown above) and the code should have delimiters surrounding the class definition. Moreover, examples will be excluded from xdoc-javadoc validation. When this issue is closed, there will be a list of all modules below in XdocsJavadocsTest. This list can be removed along with the if-statements using it.

For convenience, this issue takes care of multiple things - moving examples to test files, placing macros in place of the examples, adding id to each example, and removing examples from class javadoc.

  • AbbreviationAsWordInName
  • AbstractClassName (needs anchors)
  • AnnotationLocation
  • AnnotationOnSameLine
  • AnnotationUseStyle
  • AnonInnerLength
  • ArrayTrailingComma
  • ArrayTypeStyle
  • AtclauseOrder
  • AvoidDoubleBraceInitialization
  • AvoidEscapedUnicodeCharacters
  • AvoidInlineConditionals
  • AvoidNestedBlocks
  • AvoidNoArgumentSuperConstructorCall
  • AvoidStarImport
  • AvoidStaticImport
  • BooleanExpressionComplexity
  • CatchParameterName
  • ClassDataAbstractionCoupling
  • ClassFanOutComplexity
  • ClassMemberImpliedModifier
  • ClassTypeParameterName
  • CommentsIndentation
  • ConstantName
  • CovariantEquals
  • CustomImportOrder
  • CyclomaticComplexity
  • DeclarationOrder
  • DefaultComesLast
  • DescendantToken
  • DesignForExtension
  • EmptyBlock
  • EmptyCatchBlock
  • EmptyForInitializerPad
  • EmptyForIteratorPad
  • EmptyLineSeparator
  • EmptyStatement
  • EqualsAvoidNull
  • EqualsHashCode
  • ExecutableStatementCount
  • ExplicitInitialization
  • FallThrough
  • FileLength
  • FileTabCharacter
  • FinalClass
  • FinalLocalVariable
  • FinalParameters
  • GenericWhitespace
  • Header
  • HiddenField
  • HideUtilityClassConstructor
  • IllegalCatch
  • IllegalIdentifierName
  • IllegalImport
  • IllegalInstantiation
  • IllegalThrows
  • IllegalToken
  • IllegalTokenText
  • IllegalType
  • ImportControl
  • ImportOrder
  • Indentation
  • InnerAssignment
  • InnerTypeLast
  • InterfaceIsType
  • InterfaceMemberImpliedModifier
  • InterfaceTypeParameterName
  • InvalidJavadocPosition
  • JavadocBlockTagLocation
  • JavadocContentLocation
  • JavadocMethod
  • JavadocMissingLeadingAsterisk
  • JavadocMissingWhitespaceAfterAsterisk
  • JavadocPackage
  • JavadocParagraph
  • JavadocStyle
  • JavadocTagContinuationIndentation
  • JavadocType
  • JavadocVariable
  • JavaNCSS
  • LambdaBodyLength
  • LambdaParameterName
  • LeftCurly
  • LineLength
  • LocalFinalVariableName
  • LocalVariableName
  • MagicNumber
  • MatchXpath
  • MemberName
  • MethodCount
  • MethodLength
  • MethodName
  • MethodParamPad
  • MethodTypeParameterName
  • MissingCtor
  • MissingDeprecated
  • MissingJavadocMethod
  • MissingJavadocPackage
  • MissingJavadocType
  • MissingOverride
  • MissingSwitchDefault
  • ModifiedControlVariable
  • ModifierOrder
  • MultipleStringLiterals
  • MultipleVariableDeclarations
  • MutableException
  • NeedBraces
  • NestedForDepth
  • NestedIfDepth
  • NestedTryDepth
  • NewlineAtEndOfFile
  • NoArrayTrailingComma
  • NoClone
  • NoCodeInFile
  • NoFinalizer
  • NoLineWrap
  • NonEmptyAtclauseDescription
  • NoEnumTrailingComma
  • NoWhitespaceAfter
  • NoWhitespaceBefore
  • NoWhitespaceBeforeCaseDefaultColon
  • NPathComplexity
  • OneStatementPerLine
  • OneTopLevelClass
  • OperatorWrap
  • OrderedProperties
  • OuterTypeFilename
  • OuterTypeNumber
  • OverloadMethodsDeclarationOrder
  • PackageAnnotation
  • PackageDeclaration
  • PackageName
  • ParameterAssignment
  • ParameterName
  • ParameterNumber
  • ParenPad
  • PatternVariableName
  • RecordComponentNumber
  • RecordComponentName
  • RecordTypeParameterName
  • RedundantImport
  • RedundantModifier
  • Regexp
  • RegexpHeader
  • RegexpMultiline
  • RegexpOnFilename
  • RegexpSingleline
  • RegexpSinglelineJava
  • RequireThis
  • ReturnCount
  • RightCurly
  • SeparatorWrap
  • SimplifyBooleanExpression
  • SimplifyBooleanReturn
  • SingleLineJavadoc
  • RequireEmptyLineBeforeBlockTagGroup
  • SingleSpaceSeparator
  • StaticVariableName
  • StringLiteralEquality
  • SummaryJavadoc
  • SuperClone
  • SuperFinalize
  • SuppressWarnings
  • ThrowsCount
  • TodoComment
  • TrailingComment
  • Translation
  • TypecastParenPad
  • TypeName
  • UncommentedMain
  • UniqueProperties
  • UnnecessaryParentheses
  • UnnecessarySemicolonInEnumeration
  • UnnecessarySemicolonInTryWithResources
  • UnnecessarySemicolonAfterOuterTypeDeclaration
  • UnnecessarySemicolonAfterTypeMemberDeclaration
  • UnusedImports
  • UpperEll
  • UnusedLocalVariable
  • VariableDeclarationUsageDistance
  • VisibilityModifier
  • WhitespaceAfter
  • WhitespaceAround
  • WriteTag
  • SuppressWarningsHolder

Filters:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions