1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 22:01:48 +01:00
psalm/docs/running_psalm/command_line_usage.md

40 lines
1.4 KiB
Markdown
Raw Normal View History

2018-02-17 19:53:17 -05: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-17 19:53:17 -05:00
If you want to run on specific files, use
```bash
./vendor/bin/psalm file1.php [file2.php...]
```
## Command-line options
2018-02-17 19:53:17 -05:00
Run with `--help` to see a list of options that Psalm supports.
2019-12-03 09:53:37 -05:00
## Shepherd
Psalm currently offers some GitHub integration with public projects.
Add `--shepherd` to send information about your build to https://shepherd.dev.
Currently, Shepherd tracks type coverage (the percentage of types Psalm can infer) on `master` branches.
2020-03-22 18:42:19 -04:00
## Running Psalm faster
Psalm has a couple of command-line options that will result in faster builds:
2018-09-30 16:05:42 -04:00
- `--threads=[n]` to run Psalms analysis in a number of threads
- `--diff` which only checks files youve updated since the last run (and their dependents).
- `--diff-methods` which only checks methods youve updated since the last run (and their dependents).
Data from the last run is stored in the *cache directory*, which may be set in [configuration](./configuration.md).
If you are running Psalm on a build server, you may want to configure the server to ensure that the cache directory
is preserved between runs.
2018-09-30 16:05:42 -04:00
Running them together (e.g. `--threads=8 --diff --diff-methods`) will result in the fastest possible Psalm run.