Skip to content

Commit 3659f5b

Browse files
authored
Merge pull request #43 from shoppingflux/add_exclude_option
Add exclude option to command
2 parents e618e34 + 448e2c0 commit 3659f5b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Console/PHPCSCommand.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ protected function configure()
5656
InputOption::VALUE_NONE,
5757
'Determine if the code must be fixed before running CS checks'
5858
);
59+
$this->addOption(
60+
'exclude',
61+
null,
62+
InputOption::VALUE_REQUIRED,
63+
'A comma separated list of sniff codes to exclude from checking'
64+
);
5965
$this->addOption(
6066
'timeout',
6167
't',
@@ -82,6 +88,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8288

8389
array_push($options, ...$input->getArgument('source'));
8490

91+
if ($input->getOption('exclude')) {
92+
$options[] = '--exclude=' . $input->getOption('exclude');
93+
}
94+
8595
if ($input->getOption('progress')) {
8696
$options[] = '-p';
8797
}

0 commit comments

Comments
 (0)