com.puppycrawl.tools.checkstyle.meta.checks.header.HeaderCheck.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checkstyle Show documentation
Show all versions of checkstyle Show documentation
Checkstyle is a development tool to help programmers write Java code
that adheres to a coding standard
<?xml version="1.0" encoding="UTF-8"?> <checkstyle-metadata> <module> <check fully-qualified-name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck" name="Header" parent="com.puppycrawl.tools.checkstyle.Checker"> <description><p> Checks that a source file begins with a specified header. Property {@code headerFile} specifies a file that contains the required header. Alternatively, the header specification can be set directly in the {@code header} property without the need for an external file. </p> <p> Property {@code ignoreLines} specifies the line numbers to ignore when matching lines in a header file. This property is very useful for supporting headers that contain copyright dates. For example, consider the following header: </p> <pre> line 1: //////////////////////////////////////////////////////////////////// line 2: // checkstyle: line 3: // Checks Java source code for adherence to a set of rules. line 4: // Copyright (C) 2002 Oliver Burn line 5: //////////////////////////////////////////////////////////////////// </pre> <p> Since the year information will change over time, you can tell Checkstyle to ignore line 4 by setting property {@code ignoreLines} to {@code 4}. </p> <p> In default configuration, if header is not specified, the default value of header is set to {@code null} and the check does not rise any violations. </p></description> <properties> <property name="charset" type="java.lang.String"> <description>Specify the character encoding to use when reading the headerFile.</description> </property> <property default-value="" name="fileExtensions" type="java.lang.String[]"> <description>Specify the file extensions of the files to process.</description> </property> <property name="header" type="java.lang.String"> <description>Specify the required header specified inline. Individual header lines must be separated by the string {@code "\n"} (even on platforms with a different line separator).</description> </property> <property name="headerFile" type="java.net.URI"> <description>Specify the name of the file containing the required header.</description> </property> <property default-value="" name="ignoreLines" type="int[]"> <description>Specify the line numbers to ignore.</description> </property> </properties> <message-keys> <message-key key="header.mismatch"/> <message-key key="header.missing"/> </message-keys> </check> </module> </checkstyle-metadata>