e.g.
$ SKIP=mypy pre-commit run --files pre_commit/*.py
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check docstring is first.................................................Passed
Check JSON...........................................(no files to check)Skipped
Check Yaml...........................................(no files to check)Skipped
Debug Statements (Python)................................................Passed
Tests should end in _test.py.........................(no files to check)Skipped
Fix requirements.txt.................................(no files to check)Skipped
Fix double quoted strings................................................Passed
flake8...................................................................Passed
autopep8.................................................................Passed
Validate Pre-Commit Manifest.........................(no files to check)Skipped
pyupgrade................................................................Passed
Reorder python imports...................................................Passed
Add trailing commas......................................................Passed
setup-cfg-fmt........................................(no files to check)Skipped
mypy....................................................................Skipped
Check hooks apply to the repository..................(no files to check)Skipped
Check for useless excludes...........................(no files to check)Skipped
Versus:
$ SKIP=mypy pre-commit run --files pre_commit/*.py -q
Trim Trailing Whitespace.................................................Passed
Fix End of Files.........................................................Passed
Check docstring is first.................................................Passed
Debug Statements (Python)................................................Passed
Fix double quoted strings................................................Passed
flake8...................................................................Passed
autopep8.................................................................Passed
pyupgrade................................................................Passed
Reorder python imports...................................................Passed
Add trailing commas......................................................Passed
mypy....................................................................Skipped
Here we still show mypy which the user had said to skip.
Adding a new summary line if all hooks passed
or were skipped in either --quiet mode (where
it may be the only output) or --verbose mode
(since the summary seems worth showing here).
If using the prepare-commit-msg and commit-msg stages specifically (such
as with the try-repo command), the `--commit-msg-filename` arg must be
provided.
[fixes#1336]
chore: improve error message for hook stage check
Adds a prepare-commit-msg hook stage which allows for hooks which add
dynamic suggested/placeholder text to commit messages that an author can
use as a starting point for writing a commit message
Before there was a `getcwd` syscall for every filename which was filtered.
Instead this is now cached per-run.
- When all files are identified by filename only: ~45% improvement
- When no files are identified by filename only: ~55% improvement
This makes little difference to overall execution, the bigger win is
eliminating the `memoize_by_cwd` hack. Just removing the memoization would
have *increased* the runtime by 300-500%.