diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-22 19:00:45 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-02-22 19:00:45 +0100 |
commit | 8b99320f58be16d7da18ea7ef319bcee344bc8de (patch) | |
tree | 99a37998df99e5e8cb45611c9d0f9f34bdc5321e | |
parent | 26f7136cd9f5e69782f14f772be51d93e02f1e41 (diff) | |
download | sonarqube-8b99320f58be16d7da18ea7ef319bcee344bc8de.tar.gz sonarqube-8b99320f58be16d7da18ea7ef319bcee344bc8de.zip |
SONAR-3284 The RegExp Header CheckStyle rule incorrectly using ignoreLines instead of multiLines causing the functionality to fail every time
3 files changed, 16 insertions, 19 deletions
diff --git a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml index af6e0f68cae..37c17e03d5f 100644 --- a/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml +++ b/plugins/sonar-checkstyle-plugin/src/main/resources/org/sonar/plugins/checkstyle/rules.xml @@ -15,17 +15,18 @@ </param> </rule> - <rule key="com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck"> + <rule> + <key>com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck</key> <priority>MAJOR</priority> <name><![CDATA[Regexp Header]]></name> <configKey><![CDATA[Checker/RegexpHeader]]></configKey> - - - <param key="header" type="s"> - + <param> + <key>header</key> + <type>s</type> </param> - <param key="ignoreLines" type="s"> - + <param> + <key>multiLines</key> + <type>s</type> </param> </rule> @@ -34,16 +35,11 @@ <priority>MAJOR</priority> <name><![CDATA[Annotation Use Style]]></name> <configKey><![CDATA[Checker/TreeWalker/AnnotationUseStyle]]></configKey> - - <param key="elementStyle" type="s[expanded,compact,compact_no_array,ignore]"> - </param> <param key="closingParens" type="s[always,never,ignore]"> - </param> <param key="trailingArrayComma" type="s[always,never,ignore]"> - </param> </rule> @@ -425,9 +421,9 @@ <name><![CDATA[Declaration Order]]></name> <configKey><![CDATA[Checker/TreeWalker/DeclarationOrder]]></configKey> - <param key="ignoreConstructors" type="b" /> - <param key="ignoreMethods" type="b" /> - <param key="ignoreModifiers" type="b" /> + <param key="ignoreConstructors" type="b"/> + <param key="ignoreMethods" type="b"/> + <param key="ignoreModifiers" type="b"/> </rule> <rule key="com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck"> <priority>MAJOR</priority> @@ -1183,7 +1179,7 @@ <name><![CDATA[Package Declaration]]></name> <configKey><![CDATA[Checker/TreeWalker/PackageDeclaration]]></configKey> - <param key="ignoreDirectoryName" type="b" /> + <param key="ignoreDirectoryName" type="b"/> </rule> <rule key="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck"> diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties index b0649649483..9a844aa9683 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle.properties @@ -201,8 +201,8 @@ rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCh rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.param.option=policy on how to wrap lines. 'nl' : the operator must be on a new line, 'eol' : the operator must be at the end of the line. Default is 'nl'. rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck.param.tokens=tokens to check rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.name=Regexp Header -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.param.header=the required header specified inline. Individual header lines must be separated by the string "\n" (even on platforms with a different line separator), and regular expressions must not span multiple lines. -rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.param.ignoreLines=line numbers to repeat (zero or more times) +rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.param.header=The required header specified inline. Individual header lines must be separated by the string "\n" (even on platforms with a different line separator), and regular expressions must not span multiple lines. +rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.param.multiLines=Line numbers to repeat (zero or more times) rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck.name=Default Comes Last rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.name=No Whitespace After rule.checkstyle.com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck.param.allowLineBreaks=whether whitespace is allowed if the token is at a linebreak. Default is true. diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html index d5b28034c01..99ccee2a631 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/checkstyle/com.puppycrawl.tools.checkstyle.checks.header.RegexpHeaderCheck.html @@ -26,4 +26,5 @@ line 5: ^\W*Licensed under the Apache License, Version 2\.0 \(the "License"\);$ line 6: ^\W*$ </pre> -<p>Lines 1 and 2 leave room for technical header lines, e.g. the "#!/bin/sh" line in Unix shell scripts, or the xml file header of XML files. Set the multiline property to "1, 2" so these lines can be ignored for file types where they do no apply. Lines 3 through 6 define the actual header content. Note how lines 2, 4 and 5 use escapes for characters that have special regexp semantics.</p>
\ No newline at end of file +<p>Lines 1 and 2 leave room for technical header lines, e.g. the "#!/bin/sh" line in Unix shell scripts, or the xml file header of XML files. Set the multiline property to "1, 2" so these lines can be ignored for file types where they do no apply. Lines 3 through 6 define the actual header content. Note how lines 2, 4 and 5 use escapes for characters that have special regexp semantics.</p> +<p>Note: ignoreLines property has been removed from this check to simplify it. To make some line optional use "^.*$" regexp for this line. </p>
\ No newline at end of file |