Fix #518, provide --enforce-all option to check_added_large_files

The --enforce-all option when provided ensures that all files passed
on the command line are checked against the size limit.  Default
behaviour remains unchanged.
This commit is contained in:
Marcus Shawcroft 2020-09-16 06:26:11 +01:00 committed by Anthony Sottile
parent 31d41ff291
commit 012bb0691f
3 changed files with 47 additions and 4 deletions

View file

@ -26,8 +26,11 @@ Add this to your `.pre-commit-config.yaml`
#### `check-added-large-files`
Prevent giant files from being committed.
- Specify what is "too large" with `args: ['--maxkb=123']` (default=500kB).
- Limits checked files to those indicated as staged for addition by git.
- If `git-lfs` is installed, lfs files will be skipped
(requires `git-lfs>=2.2.1`)
- `--enforce-all` - Check all listed files not just those staged for
addition.
#### `check-ast`
Simply check whether files parse as valid python.