improvements/fixes after code review

This commit is contained in:
Alessio Izzo 2024-02-26 16:04:02 +01:00 committed by Anthony Sottile
parent e36cdc227c
commit f6c6b6c55f
3 changed files with 2 additions and 13 deletions

1
.gitignore vendored
View file

@ -4,4 +4,3 @@
/.tox /.tox
/dist /dist
.vscode/ .vscode/
.idea

View file

@ -372,12 +372,8 @@ def run(
): ):
return 0 return 0
# prevent pushing staged files not committed (#2486) # prevent pushing staged files not committed (#2486)
if ( if args.hook_stage == 'pre-push' and git.get_staged_files():
args.hook_stage == 'pre-push' and git.get_staged_files() logger.error('Staged files found. Please commit before pushing')
):
logger.error(
'Staged files found. Please commit before pushing',
)
return 1 return 1
# Expose prepare_commit_message_source / commit_object_name # Expose prepare_commit_message_source / commit_object_name
# as environment variables for the hooks # as environment variables for the hooks

View file

@ -364,12 +364,6 @@ def test_show_diff_on_failure(
1, 1,
False, False,
), ),
(
{'hook': 'nope', 'hook_stage': 'pre-push'},
(b'[ERROR] Staged files found. Please commit before pushing\n',),
1,
True,
),
( (
{'all_files': True, 'verbose': True}, {'all_files': True, 'verbose': True},
(b'foo.py',), (b'foo.py',),