Skip to content

Commit

Permalink
Make failure on match default
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuurlijk committed Sep 17, 2020
1 parent 8ff8635 commit 46f8f00
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/bin/phpunit
/vendor/
typo3scan.phar
/.idea
/.idea
!/typo3scan.phar
2 changes: 1 addition & 1 deletion bin/typo3scan
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ foreach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../../../../autoload.p

use MichielRoos\TYPO3Scan\Console\Application;

$app = new Application('TYPO3Scan', '1.7.0');
$app = new Application('TYPO3Scan', '1.7.1');
$app->add(new \MichielRoos\TYPO3Scan\Command\ScanCommand);
$app->run();
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
"MichielRoos\\TYPO3Scan\\": "src/TYPO3Scan"
}
},
"bin": ["bin/typo3scan"],
"bin": [
"bin/typo3scan",
"typo3scan.phar"
],
"config": {
"bin-dir": "bin",
"optimize-autoloader": true,
Expand Down
8 changes: 2 additions & 6 deletions src/TYPO3Scan/Command/ScanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ protected function configure()
new InputOption('format', 'f', InputOption::VALUE_OPTIONAL, 'Output format', 'plain'),
new InputOption('reportFile', 'r', InputOption::VALUE_OPTIONAL, 'Report file', null),
new InputOption('templatePath', null, InputOption::VALUE_OPTIONAL, 'Path to template folder'),
new InputOption('failOnMatch', null, InputOption::VALUE_NONE, 'Fail if there are matches, useful for CI checks', false),
])
->setHelp(<<<EOT
The <info>scan</info> command scans a path for deprectated code</info>.
The <info>scan</info> command scans a path for deprecated code</info>.
Scan a folder:
<info>php typo3scan.phar scan ~/tmp/source</info>
Expand All @@ -85,9 +84,6 @@ protected function configure()
Scan a folder for v7 changes, only show the breaking changes and output in markdown:
<info>php typo3scan.phar scan --target 7 --only breaking --format markdown ~/tmp/source</info>
Scan a folder for changes, fail if there are matches (useful for CI checks):
<info>php typo3scan.phar scan --target 10 --only breaking --fail-on-match ~/tmp/source</info>
EOT
);
}
Expand Down Expand Up @@ -188,7 +184,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->write($template->render($context));
}

if ($total > 0 && $input->getOption('failOnMatch')) {
if ($total > 0) {
return 1;
}

Expand Down
Binary file added typo3scan.phar
Binary file not shown.

0 comments on commit 46f8f00

Please sign in to comment.