All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.puppycrawl.tools.checkstyle.meta.checks.header.HeaderCheck.xml Maven / Gradle / Ivy

Go to download

Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard

There is a newer version: 10.20.1
Show newest version
<?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>&lt;p&gt;
 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.
 &lt;/p&gt;
 &lt;p&gt;
 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:
 &lt;/p&gt;
 &lt;pre&gt;
 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: ////////////////////////////////////////////////////////////////////
 &lt;/pre&gt;
 &lt;p&gt;
 Since the year information will change over time, you can tell Checkstyle
 to ignore line 4 by setting property {@code ignoreLines} to {@code 4}.
 &lt;/p&gt;
 &lt;p&gt;
 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.
 &lt;/p&gt;</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>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy