Rework CLI input and scope handling#33
Conversation
ce2dbce to
0563975
Compare
4d87315 to
7c3fc93
Compare
7c3fc93 to
c26bc1e
Compare
c26bc1e to
78d850b
Compare
|
Rebased and ready for review. |
| * @throws \RuntimeException if redirected stdin cannot be read. | ||
| * @api | ||
| */ | ||
| public static function fromGlobals(array $argv): self |
There was a problem hiding this comment.
withArguments would be better since Globals could mean something different.
| array $argv, | ||
| mixed $stdout = null, | ||
| mixed $stderr = null, | ||
| ?string $stdin = null, |
There was a problem hiding this comment.
Having $stdin as a string variable doesn't make sense. We should rename this to $diff or $diffContents.
| try { | ||
| $runner = new SniffRunner($progress); | ||
| $report = $runner->run($config, $overridePaths, $diff); | ||
| $report = $runner->run($runPlan); |
| <directory>tests/Integration</directory> | ||
| </testsuite> | ||
| <testsuite name="feature"> | ||
| <directory>tests/Feature</directory> |
There was a problem hiding this comment.
As mentioned in an earlier PR, I prefer to have this in Unit as well.
| } | ||
|
|
||
| $candidates[] = sprintf('refs/remotes/%s/main', $remote); | ||
| $candidates[] = sprintf('refs/remotes/%s/master', $remote); |
There was a problem hiding this comment.
This is checking remote. Which wouldn't be a bad thing to do. But when having multiple remotes (origin & upstream) which one wil this choose?
I did notice that my upstream was not up-to-date with origin. Docbook-cs did report false positives because of that. For that reason it might be better to check locally.
For branches, check with the master/main. For the master, check the current uncommitted (or not pushed) changes.
Makes diff the default input, detects piped diffs automatically, adds
--wide, and separates input planning from execution.Depends on #29, #30, #31, and #32.
This PR diff will shrink as preceding PRs are merged and this branch is rebased.
As discussed
--diff-behaviour is now the default. Piping a diff is still possible and detected automatically -- it no longer requires a--diffflag and diffs can be piped, hence--diffhad no more function and was removed. Passing paths works as before. Since diff is not default, full runs are now covered by eitherdocbook-cs .ordocbook-cs path/docs-root/. What we discussed as--greedyis now--wider. The table shows how it works.--wide<path><path>git diff | …git diff | …