mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 10:31:46 +04:00
New option to allow modified files
This commit is contained in:
parent
7728162d7a
commit
858e89865e
3 changed files with 16 additions and 2 deletions
|
|
@ -101,6 +101,13 @@ def _add_run_options(parser):
|
|||
'--show-diff-on-failure', action='store_true',
|
||||
help='When hooks fail, run `git diff` directly afterward.',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--modified-files-ok', '-m', action='store_true',
|
||||
default='PRE_COMMIT_MODIFIED_FILES_OK' in os.environ,
|
||||
help="File modification by hooks won't be equated with failure. "
|
||||
'Equivalent to setting the environment variable '
|
||||
'PRE_COMMIT_MODIFIED_FILES_OK=true.',
|
||||
)
|
||||
mutex_group = parser.add_mutually_exclusive_group(required=False)
|
||||
mutex_group.add_argument(
|
||||
'--all-files', '-a', action='store_true', default=False,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue