Commit 0369442
fix(phpcs): run from project root instead of file directory (dense-analysis#5105)
When phpcs.xml sets installed_paths to a relative path (e.g.
vendor/slevomat/coding-standard), running phpcs from the file's
directory causes it to fail because the path is resolved relative to
cwd rather than the config file location.
Change cwd to find the nearest composer.json and use that directory,
matching how most PHP ecosystem tools expect to operate.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 69c945d commit 0369442
File tree
3 files changed
+31
-2
lines changed- ale_linters/php
- test
- linter
- test-files/phpcs/project-with-phpcs
3 files changed
+31
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 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 | + | |
10 | 38 | | |
11 | 39 | | |
12 | 40 | | |
| |||
48 | 76 | | |
49 | 77 | | |
50 | 78 | | |
51 | | - | |
| 79 | + | |
52 | 80 | | |
53 | 81 | | |
54 | 82 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments