Skip to content

Commit b381e77

Browse files
committed
Fixed bug #452 : Ruleset exclude-pattern for specific sniff code ignored when using CLI --ignore option
1 parent 825f86a commit b381e77

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CodeSniffer/CLI.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,8 @@ public function process($values=array())
842842

843843
// Set ignore patterns if they were specified.
844844
if (empty($values['ignored']) === false) {
845-
$phpcs->setIgnorePatterns($values['ignored']);
845+
$ignorePatterns = array_merge($phpcs->getIgnorePatterns(), $values['ignored']);
846+
$phpcs->setIgnorePatterns($ignorePatterns);
846847
}
847848

848849
// Set some convenience member vars.

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
8686
- Fixed bug #414 : Squiz.WhiteSpace.MemberVarSpacing - inconsistent checking of member vars with comment
8787
- Fixed bug #433 : Wrong detection of Squiz.Arrays.ArrayDeclaration.KeyNotAligned when key contains space
8888
- Fixed bug #434 : False positive for spacing around "=>" in inline array within foreach
89+
- Fixed bug #452 : Ruleset exclude-pattern for specific sniff code ignored when using CLI --ignore option
8990
- Fixed bug #20482 : Scope indent sniff can get into infinite loop when processing a parse error
9091
</notes>
9192
<contents>

0 commit comments

Comments
 (0)