Skip to content

Commit

Permalink
Added ability to ignore patch to check CS
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Sep 3, 2021
1 parent 0a9f929 commit 241ff70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Commands/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'--standard=' . $input->getOption('ruleset'),
], $this->helper->wrapPaths($input->getArgument('paths')));

if ($input->hasOption('ignore')) {
$_SERVER['argv'][] = '--ignore=' . $input->getOption('ignore');
}

$runner = new Runner();
$exitCode = $runner->runPHPCS();

Expand All @@ -52,6 +56,12 @@ protected function configure()
InputArgument::IS_ARRAY | InputArgument::REQUIRED,
'Enumerate directories or files to check'
)
->addOption(
'ignore',
'i',
InputArgument::OPTIONAL,
'A comma separated list of patterns to ignore files and directories'
)
->addOption(
'ruleset',
'r',
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/FixCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function configure()
->addArgument(
'paths',
InputArgument::IS_ARRAY | InputArgument::REQUIRED,
'Enumerate directories or files to check'
'Enumerate directories or files to fix'
)
->addOption(
'config',
Expand Down

0 comments on commit 241ff70

Please sign in to comment.