1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Clarify documentation of --diff and --diff-methods (#2680)

* Clarify documentation of --diff and --diff-methods

* Save Psalm cache in CircleCI
This commit is contained in:
Barney Laurance 2020-01-25 15:50:11 +00:00 committed by Matthew Brown
parent 8c89760ff3
commit 4a4c0f1362
3 changed files with 16 additions and 5 deletions

View File

@ -18,14 +18,21 @@ jobs:
- composer-v2-{{ checksum "/tmp/cachekey" }}
# fallback to using the latest cache if no exact match is found (See https://circleci.com/docs/2.0/caching/)
- composer-v2-
- restore_cache:
keys:
- psalm-cache-{{ checksum "/tmp/cachekey" }} # speeds up run with --diff and --diff-methods
- run: composer update
- save_cache:
key: composer-v2-{{ checksum "/tmp/cachekey" }}
paths:
- vendor
- save_cache:
key: psalm-cache-{{ checksum "/tmp/cachekey" }}
paths:
- /tmp/psalm
- run:
name: Static analysis
command: php -dextension=pcntl.so ./psalm --threads=10
command: php -dextension=pcntl.so ./psalm --threads=10 --diff --diff-methods
- persist_to_workspace:
root: /home/docker/project/
paths:

View File

@ -29,7 +29,11 @@ Currently, Shepherd tracks type coverage (the percentage of types Psalm can infe
Psalm has a couple of command-line options that will result in faster builds:
- `--threads=[n]` to run Psalms analysis in a number of threads
- `--diff` which only checks files youve updated (and their dependents).
- `--diff-methods` which remembers Psalms output when scanning particular methods.
- `--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.
Running them together (e.g. `--threads=8 --diff --diff-methods`) will result in the fastest possible Psalm run.

View File

@ -284,10 +284,10 @@ Basic configuration:
If greater than one, Psalm will run analysis on multiple threads, speeding things up.
--diff
Runs Psalm in diff mode, only checking files that have changed (and their dependents)
Runs Psalm in diff mode, only checking files that have changed since last run (and their dependents)
--diff-methods
Only checks methods that have changed (and their dependents)
Only checks methods that have changed since last run (and their dependents)
Surfacing issues:
--show-info[=BOOLEAN]