---
title: pun check
description: Format, lint, and analyse in one run. Apply format and lint fixes with --fix.
---

`pun check` reports findings without editing files. `--fix` applies formatting and lint fixes, except rules with `fix = "off"`. Analysis never edits files.

```bash
pun check
pun check --fix
```

A migrated Pint config needs `pun check --fix`, not `pun format`, because Pint's risky and code-deleting fixers are lint rules.

## Options

`pun check` takes the [format flags](/docs/commands/format#pints-flags) and the [lint level flags](/docs/commands/lint#levels-on-the-command-line). Analysis uses the `[analyse]` settings, ignore comments, and the configured baseline.

Format and lint use the [result cache](/docs/commands/format#cache). Analysis checks every file on every run. `--no-cache` turns the cache off.

```bash
pun check --dirty
pun check --staged
pun check --deny-warnings
pun check --format=github
```

## Output

```
$ 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)
```

`--concise` prints one line per problem. For PHPStan-compatible reports, use [`pun analyse`](/docs/commands/analyse).

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | No remaining errors or format changes |
| 1 | Format changes, lint errors, analysis errors, or a warning limit exceeded |
| 2 | Pun could not run |
