|
8 | 8 | | Pest | `--compact --colors=never` | |
9 | 9 | | ParaTest | `--no-progress --colors=never --display-errors --display-warnings` | |
10 | 10 | | PHPStan | `--no-progress --no-ansi --error-format=raw` | |
11 | | -| Psalm | `--no-progress --monochrome --show-snippet=false --no-suggestions --output-format=text` | |
| 11 | +| Psalm | `--no-progress --no-suggestions --output-format=text` | |
12 | 12 | | phpcs | `--report=emacs -q --no-colors` | |
13 | 13 | | phpcbf | `-q --no-colors` | |
14 | 14 | | PHP-CS-Fixer | `--show-progress=none --no-ansi -n` | |
@@ -68,18 +68,20 @@ Other formats: `table` (default, noisy), `json`, `prettyJson`, `checkstyle`, `gi |
68 | 68 |
|
69 | 69 | The `raw` format is the most token-efficient — one line per error. Note: PHPStan prints a `Note: Using configuration file...` line to stderr when auto-discovering a config file. |
70 | 70 |
|
| 71 | +**PHPStan 2.x agent detection:** PHPStan 2.x includes an `AgentDetector` that checks for env vars like `CLAUDECODE`, `CURSOR_TRACE_ID`, `OPENCODE`, etc. When detected, it prepends a ~600-byte "Instructions for interpreting errors" preamble and appends `[identifier=...]` to each error line in `raw` format. The preamble is emitted on every run regardless of `--error-format`. The identifiers are useful (they name the specific rule), but the preamble adds fixed overhead per invocation. |
| 72 | + |
71 | 73 | ## Psalm |
72 | 74 |
|
73 | 75 | ```bash |
74 | | -vendor/bin/psalm --no-progress --monochrome --show-snippet=false --no-suggestions --output-format=text |
| 76 | +vendor/bin/psalm --no-progress --no-suggestions --output-format=text |
75 | 77 | ``` |
76 | 78 |
|
77 | 79 | - `--output-format=text` — one error per line: `file:line:col:severity - IssueType: message` |
78 | 80 | - `--no-progress` — disables progress indicator |
79 | | -- `--monochrome` / `-m` — disables colors |
80 | | -- `--show-snippet=false` — hides code snippets (saves tokens) |
81 | 81 | - `--no-suggestions` — hides fix suggestions |
82 | 82 |
|
| 83 | +Note: `--monochrome` and `--show-snippet=false` are sometimes recommended but have no effect with `--output-format=text` — the `text` format never outputs ANSI colors or code snippets (those only appear in the default `console` format). |
| 84 | + |
83 | 85 | Other formats: `compact`, `console`, `json`, `json-summary`, `junit`, `by-issue-level`, `count`, `github`, `checkstyle`, `codeclimate`, `emacs`, `phpstorm`, `pylint`, `sarif`, `sonarqube`, `xml`. |
84 | 86 |
|
85 | 87 | [//]: # (> **Psalm 7+:** Use `--output-format=compact` instead of `text` — it becomes a true one-line-per-error format. In Psalm 6 and below, `compact` misleadingly renders box-drawing tables.) |
@@ -208,7 +210,7 @@ Copy this into your project's AGENTS.md or CLAUDE.md: |
208 | 210 | - Tests (with a filter): `vendor/bin/phpunit --no-progress --colors=never --filter=MethodName` |
209 | 211 | - Tests (Pest): `vendor/bin/pest --compact --colors=never` |
210 | 212 | - Static analysis (PHPStan): `vendor/bin/phpstan analyse --no-progress --no-ansi --error-format=raw` |
211 | | -- Static analysis (Psalm): `vendor/bin/psalm --no-progress --monochrome --show-snippet=false --no-suggestions --output-format=text` |
| 213 | +- Static analysis (Psalm): `vendor/bin/psalm --no-progress --no-suggestions --output-format=text` |
212 | 214 | - Code style check: `vendor/bin/phpcs --report=emacs -q --no-colors` |
213 | 215 | - Code style fix (phpcs): `vendor/bin/phpcbf -q --no-colors` |
214 | 216 | - Code style fix (php-cs-fixer): `vendor/bin/php-cs-fixer fix --show-progress=none --no-ansi -n` |
|
0 commit comments