rename must-match-git-diff to shorter and easier to write match-git-diff

This commit is contained in:
TomasVotruba 2019-11-24 01:00:46 +01:00
parent 73dff9bdc4
commit 0eceb8a607
4 changed files with 9 additions and 5 deletions

View File

@ -203,10 +203,14 @@ parameters:
### Limit Execution to Changed Files
Execution can be limited to changed files using the `process` option `--must-match-git-diff`.
Execution can be limited to changed files using the `process` option `--match-git-diff`.
This option will filter the files included by the configuration, creating an intersection with the files listed in `git diff`.
This option is useful in CI.
```bash
vendor/bin/rector process src --match-git-diff
```
This option is useful in CI with pull-requests that only change few files.
## 3 Steps to Create Your Own Rector

View File

@ -56,7 +56,7 @@ final class Configuration
{
$this->isDryRun = (bool) $input->getOption(Option::OPTION_DRY_RUN);
$this->hideAutoloadErrors = (bool) $input->getOption(Option::HIDE_AUTOLOAD_ERRORS);
$this->mustMatchGitDiff = (bool) $input->getOption(Option::MUST_MATCH_GIT_DIFF);
$this->mustMatchGitDiff = (bool) $input->getOption(Option::MATCH_GIT_DIFF);
$this->showProgressBar = $this->canShowProgressBar($input);
$this->setRule($input->getOption(Option::OPTION_RULE));

View File

@ -69,5 +69,5 @@ final class Option
/**
* @var string
*/
public const MUST_MATCH_GIT_DIFF = 'must-match-git-diff';
public const MATCH_GIT_DIFF = 'match-git-diff';
}

View File

@ -149,7 +149,7 @@ final class ProcessCommand extends AbstractCommand
);
$this->addOption(
Option::MUST_MATCH_GIT_DIFF,
Option::MATCH_GIT_DIFF,
null,
InputOption::VALUE_NONE,
'Execute only on file matching the git diff.'