diff options
Diffstat (limited to 'pre_commit/commands/run.py')
-rw-r--r-- | pre_commit/commands/run.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index d906d5b..95ad5e9 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -245,7 +245,9 @@ def _compute_cols(hooks: Sequence[Hook]) -> int: def _all_filenames(args: argparse.Namespace) -> Collection[str]: # these hooks do not operate on files - if args.hook_stage in {'post-checkout', 'post-commit', 'post-merge'}: + if args.hook_stage in { + 'post-checkout', 'post-commit', 'post-merge', 'post-rewrite', + }: return () elif args.hook_stage in {'prepare-commit-msg', 'commit-msg'}: return (args.commit_msg_filename,) @@ -386,6 +388,9 @@ def run( if args.is_squash_merge: environ['PRE_COMMIT_IS_SQUASH_MERGE'] = args.is_squash_merge + if args.rewrite_command: + environ['PRE_COMMIT_REWRITE_COMMAND'] = args.rewrite_command + # Set pre_commit flag environ['PRE_COMMIT'] = '1' |