Add new two new rules to Checkstyle.
- Add Android copyright header check
- Add comment suppression filter rule to enable suppressing indentation check
Usage:
// CHECKSTYLE:OFF IndentationCheck
Code.With();
Bad = Indentation;
// CHECKSTYLE:ON IndentationCheck
Bug: 26747466
Change-Id: I837d7bde1fd85250678a3aba66309043bfc324b1
This commit is contained in:
@@ -4,6 +4,11 @@
|
||||
<module name="Checker">
|
||||
<property name="severity" value="warning"/>
|
||||
<property name="charset" value="UTF-8"/>
|
||||
<module name="SuppressionCommentFilter">
|
||||
<property name="offCommentFormat" value="CHECKSTYLE:OFF IndentationCheck"/>
|
||||
<property name="onCommentFormat" value="CHECKSTYLE:ON IndentationCheck"/>
|
||||
<property name="checkFormat" value="IndentationCheck"/>
|
||||
</module>
|
||||
<module name="TreeWalker">
|
||||
<module name="AvoidStarImport">
|
||||
<property name="severity" value="error"/>
|
||||
@@ -192,6 +197,7 @@
|
||||
<property name="tokens" value="COMMA"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="FileContentsHolder"/>
|
||||
</module>
|
||||
<module name="FileTabCharacter">
|
||||
<property name="severity" value="error"/>
|
||||
@@ -201,10 +207,8 @@
|
||||
<property name="format" value="[ \t]+$"/>
|
||||
<property name="message" value="Trailing whitespace"/>
|
||||
</module>
|
||||
<!--
|
||||
<module name="RegexpHeader">
|
||||
<property name="severity" value="error"/>
|
||||
<property name="header" value="^/*$\n^ * Copyright (C) 2015 The Android Open Source Project" />
|
||||
<property name="header" value="^/\*\n \* Copyright \(C\) [0-9]{4} The Android Open Source Project\n \*\n \* Licensed under the Apache License, Version 2\.0 \(the \"License\"\);\n \* you may not use this file except in compliance with the License.\n \* You may obtain a copy of the License at\n \*\n \* http:\/\/www\.apache\.org\/licenses\/LICENSE-2\.0\n \*\n \* Unless required by applicable law or agreed to in writing, software\n \* distributed under the License is distributed on an "AS IS" BASIS,\n \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.\n \* See the License for the specific language governing permissions and\n \* limitations under the License\.\n \*\/" />
|
||||
</module>
|
||||
-->
|
||||
</module>
|
||||
|
||||
Reference in New Issue
Block a user