2018-02-18 01:53:17 +01:00
|
|
|
|
# Running Psalm
|
|
|
|
|
|
|
|
|
|
Once you've set up your config file, you can run Psalm from your project's root directory with
|
|
|
|
|
```bash
|
|
|
|
|
./vendor/bin/psalm
|
|
|
|
|
```
|
|
|
|
|
|
2019-02-12 23:35:28 +01:00
|
|
|
|
and Psalm will scan all files in the project referenced by `<projectFiles>`.
|
2018-02-18 01:53:17 +01:00
|
|
|
|
|
|
|
|
|
If you want to run on specific files, use
|
|
|
|
|
```bash
|
|
|
|
|
./vendor/bin/psalm file1.php [file2.php...]
|
|
|
|
|
```
|
|
|
|
|
|
2018-09-30 17:13:12 +02:00
|
|
|
|
## Command-line options
|
2018-02-18 01:53:17 +01:00
|
|
|
|
|
|
|
|
|
Run with `--help` to see a list of options that Psalm supports.
|
2018-09-30 17:13:12 +02:00
|
|
|
|
|
|
|
|
|
### Running Psalm faster
|
|
|
|
|
|
|
|
|
|
Psalm has a couple of command-line options that will result in faster builds:
|
|
|
|
|
|
2018-09-30 22:05:42 +02:00
|
|
|
|
- `--threads=[n]` to run Psalm’s analysis in a number of threads
|
|
|
|
|
- `--diff` which only checks files you’ve updated (and their dependents).
|
2018-10-07 06:42:25 +02:00
|
|
|
|
- `--diff-methods` which remembers Psalm’s output when scanning particular methods.
|
2018-09-30 22:05:42 +02:00
|
|
|
|
|
2018-10-07 06:42:25 +02:00
|
|
|
|
Running them together (e.g. `--threads=8 --diff --diff-methods`) will result in the fastest possible Psalm run.
|