1
0
Fork 0

Adding upstream version 2.13.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:27:56 +01:00
parent 9a762b409f
commit af2c814963
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
27 changed files with 1249 additions and 80 deletions

View file

@ -526,9 +526,9 @@ def test_merge_conflict(cap_out, store, in_merge_conflict):
def test_merge_conflict_modified(cap_out, store, in_merge_conflict):
# Touch another file so we have unstaged non-conflicting things
assert os.path.exists('dummy')
with open('dummy', 'w') as dummy_file:
dummy_file.write('bar\nbaz\n')
assert os.path.exists('placeholder')
with open('placeholder', 'w') as placeholder_file:
placeholder_file.write('bar\nbaz\n')
ret, printed = _do_run(cap_out, store, in_merge_conflict, run_opts())
assert ret == 1
@ -600,6 +600,29 @@ def test_skip_aliased_hook(cap_out, store, aliased_repo):
assert printed.count(msg) == 1
def test_skip_bypasses_installation(cap_out, store, repo_with_passing_hook):
config = {
'repo': 'local',
'hooks': [
{
'id': 'skipme',
'name': 'skipme',
'entry': 'skipme',
'language': 'python',
'additional_dependencies': ['/pre-commit-does-not-exist'],
},
],
}
add_config_to_repo(repo_with_passing_hook, config)
ret, printed = _do_run(
cap_out, store, repo_with_passing_hook,
run_opts(all_files=True),
{'SKIP': 'skipme'},
)
assert ret == 0
def test_hook_id_not_in_non_verbose_output(
cap_out, store, repo_with_passing_hook,
):
@ -808,9 +831,9 @@ def test_local_hook_passes(cap_out, store, repo_with_passing_hook):
}
add_config_to_repo(repo_with_passing_hook, config)
with open('dummy.py', 'w') as staged_file:
with open('placeholder.py', 'w') as staged_file:
staged_file.write('"""TODO: something"""\n')
cmd_output('git', 'add', 'dummy.py')
cmd_output('git', 'add', 'placeholder.py')
_test_run(
cap_out,
@ -835,9 +858,9 @@ def test_local_hook_fails(cap_out, store, repo_with_passing_hook):
}
add_config_to_repo(repo_with_passing_hook, config)
with open('dummy.py', 'w') as staged_file:
with open('placeholder.py', 'w') as staged_file:
staged_file.write('"""TODO: something"""\n')
cmd_output('git', 'add', 'dummy.py')
cmd_output('git', 'add', 'placeholder.py')
_test_run(
cap_out,