pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/pre-commit/pre-commit/commit/fc622159a6c5cd31919ed2a22fa1c11d8ca56dbf

ef="https://github.githubassets.com/assets/global-d18f184ea1a06a2c.css" /> fix per-hook fail_fast to not fail on previous failures · pre-commit/pre-commit@fc62215 · GitHub
Skip to content

Commit fc62215

Browse files
committed
fix per-hook fail_fast to not fail on previous failures
1 parent 716da1e commit fc62215

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

pre_commit/commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def _run_hooks(
298298
verbose=args.verbose, use_color=args.color,
299299
)
300300
retval |= current_retval
301-
if retval and (config['fail_fast'] or hook.fail_fast):
301+
if current_retval and (config['fail_fast'] or hook.fail_fast):
302302
break
303303
if retval and args.show_diff_on_failure and prior_diff:
304304
if args.all_files:

tests/commands/run_test.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,22 @@ def test_fail_fast_per_hook(cap_out, store, repo_with_failing_hook):
10881088
assert printed.count(b'Failing hook') == 1
10891089

10901090

1091+
def test_fail_fast_not_prev_failures(cap_out, store, repo_with_failing_hook):
1092+
with modify_config() as config:
1093+
config['repos'].append({
1094+
'repo': 'meta',
1095+
'hooks': [
1096+
{'id': 'identity', 'fail_fast': True},
1097+
{'id': 'identity', 'name': 'run me!'},
1098+
],
1099+
})
1100+
stage_a_file()
1101+
1102+
ret, printed = _do_run(cap_out, store, repo_with_failing_hook, run_opts())
1103+
# should still run the last hook since the `fail_fast` one didn't fail
1104+
assert printed.count(b'run me!') == 1
1105+
1106+
10911107
def test_classifier_removes_dne():
10921108
classifier = Classifier(('this_file_does_not_exist',))
10931109
assert classifier.filenames == []

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy