ヘッダのチェック。
親モジュール | TreeWalker |
---|---|
実装クラス | com.puppycrawl.tools.checkstyle.checks.HeaderCheck |
ソースファイルが、指定されたヘッダから始まっていることをチェックします。
プロパティ名 | 型 | デフォルト | 概要 |
headerFile | String | null | ヘッダの定義が入っているファイルの名前 |
ignoreLines | Integer Set | なし | チェックをとばす行番号のセット |
<module name = "Header"> <property name = "headerFile" value = "java.header" /> <property name = "ignoreLines" value = "2, 5" /> </module>
<rule-configuration classname = "com.puppycrawl.tools.checkstyle.checks.HeaderCheck" severity = "warning"> <config-properties> <config-property name = "headerFile" value = "java.header" /> <config-property name = "ignoreLines" value = "2, 5" /> </config-properties> </rule-configuration>
親モジュール | TreeWalker |
---|---|
実装クラス | com.puppycrawl.tools.checkstyle.checks.RegexpHeaderCheck |
Header では固定パターンのファイルでしたが、この Check では、指定したファイル内の正規表現を認識します。これにより、もっと複雑なチェックが可能になります。
ここで使われる正規表現エンジンは、Jakarta Regexp です。どのようなパターンが利用できるかは、http://jakarta.apache.org/regexp/apidocs/org/apache/regexp/RE.html を見てください。
プロパティ名 | 型 | デフォルト | 概要 |
headerFile | String | null | ヘッダの定義が入っているファイルの名前 |
ignoreLines | Integer Set | なし | チェックをとばす行番号のセット |
<module name = "Header"> <property name = "headerFile" value = "java.re.header" /> <property name = "ignoreLines" value = "2, 5" /> </module>
<rule-configuration classname = "com.puppycrawl.tools.checkstyle.checks.HeaderCheck" severity = "warning"> <config-properties> <config-property name = "headerFile" value = "java.re.header" /> <config-property name = "ignoreLines" value = "2, 5" /> </config-properties> </rule-configuration>