Repository navigation
Commit 94222b2
committed
Make the feature file code style check work outside this package
The root of this package was derived from `dirname "$0"`, but Composer
installs these scripts as a symlink in the vendor binary directory, where
that resolves to `vendor` instead. `vendor/utils/extract-feature-php.php`
does not exist, so the check was skipped in every package using the testing
framework and only ever ran here, where `bin` and `utils` are siblings.
The symlink is now resolved first, the way `run-phpstan-tests` already does.
PHPCS truncates a reported path from the left once it grows past the width
of the report, which happened before the temporary directory was rewritten
out of it and left findings pointing at `...N1dTe6Y/some/feature.feature`.
Passing `--basepath` reduces the paths to the part worth showing, so the
report needs a single anchored substitution and no longer depends on the
length of a path it does not control.
The list of sniffs that do not apply to a block was spelled out in both
scripts. A future edit to one of them would have had the fixer rewrite
feature files over something the check never reports, so the list moves to
`phpcs/feature-files.sh`, which both read. That also gets the fixer the
`--warning-severity=0` only the check was passing. A package replaces the
defaults by adding a `phpcs-feature-files.xml` ruleset to its root.
The blocks are left alone when a run is narrowed down to a path, as in
`composer phpcs -- src/`, since such an argument is about the files of the
package itself rather than about its feature files.1 parent 3c60271 commit 94222b2
3 files changed
Lines changed: 175 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
14 | 62 | | |
15 | 63 | | |
16 | 64 | | |
17 | 65 | | |
18 | 66 | | |
19 | | - | |
| 67 | + | |
20 | 68 | | |
21 | | - | |
| 69 | + | |
22 | 70 | | |
23 | | - | |
24 | | - | |
| 71 | + | |
| 72 | + | |
25 | 73 | | |
26 | 74 | | |
27 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
14 | 62 | | |
15 | 63 | | |
16 | 64 | | |
17 | 65 | | |
18 | 66 | | |
19 | | - | |
| 67 | + | |
| 68 | + | |
20 | 69 | | |
21 | | - | |
| 70 | + | |
22 | 71 | | |
23 | 72 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
31 | 80 | | |
| 81 | + | |
32 | 82 | | |
| 83 | + | |
33 | 84 | | |
34 | | - | |
35 | | - | |
36 | 85 | | |
37 | 86 | | |
38 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments