-
-
Notifications
You must be signed in to change notification settings - Fork 744
check-added-large-files does not check files when run in a CI loop #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
this is by design, it's intended to allow existing things to exist but error on anything moving forward |
@mshawcroft one idea would be to add an option to check everything regardless (not sure what it would be called) -- would you be interested in contributing something like that? |
@asottile Im happy to propose a patch. I don't have any great suggestion for an option name, but note that some of the other commands in the repo appear to adopt a convention of --xxx and --no-xxx, so how about --no-check-only-staged ? |
maybe |
…_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.
…_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.
Fix #518, provide --enforce-all option to check_added_large_files
check-added-large-files works as expected when executed as a pre-commit hook, but when executed in a CI loop via run --all-files it does not diagnose over size files. This appears to be because the list of files provided on the command line is filtered to remove files that are not reported as staged for addition by git diff. Hence if a developer chooses not to install pre-commit as a git hook and adds an over size file, this will not subsequently be picked up by pre-commit running in CI.
The text was updated successfully, but these errors were encountered: