pun check
Run format, lint and analyse together.
Run format, lint and analyse in one go. Use --fix to apply the format and lint fixes.
Usage
pun check [paths] [options]
pun check # report only
pun check --fix # apply format and lint fixes
pun check --dirty # only changed files
pun check --format=github
Options
| Option | Description |
|---|---|
--fix |
Apply format and lint fixes. Analyse never edits files. |
--concise |
One line per problem. |
Check also takes the options of pun format and pun lint.
What happens
- Runs format, then lint, then analyse.
- Prints the results grouped by command, then one summary line.
- Without
--fix, changes nothing. - Reads standard input (
-or--stdin-filename) only with--fix. Without--fix, standard input is a run error (exit 2).
$ pun check
✔ format All files formatted
✖ lint 2 errors in 1 file · 1 fixable
app/Http/Controllers/PostController.php:12:9 lint/dead-code/no-unused-assignment
Remove this assignment; nothing reads the variable after it.
app/Http/Controllers/PostController.php:12:17 lint/laravel/no-request-all
Avoid using `$request->all()` or `Request::all()`.
✖ analyse 1 error in 1 file
app/Models/Post.php:11:9 analyse/undefined/method
Call to an undefined method App\Models\Post::publsh().
✖ 3 errors · 1 fixable (run pun check --fix)
Exit codes
| Code | Meaning |
|---|---|
| 0 | No errors and nothing to format. |
| 1 | Files to format, lint errors, analyse errors, or too many warnings. |
| 2 | Pun could not run. |