Add pre-commit framework and hooks config, update README

This commit is contained in:
2025-11-15 08:23:20 +00:00
parent 7e989355b9
commit 2b24d252a1
6 changed files with 433 additions and 7 deletions

View File

@@ -60,7 +60,9 @@ def test_backup_original(tmp_path, monkeypatch):
# Freeze timestamps
monkeypatch.setattr(
time, "gmtime", lambda: time.struct_time((2023, 1, 2, 3, 4, 5, 0, 0, 0))
time,
"gmtime",
lambda: time.struct_time((2023, 1, 2, 3, 4, 5, 0, 0, 0)),
)
monkeypatch.setattr(
time,
@@ -71,7 +73,9 @@ def test_backup_original(tmp_path, monkeypatch):
}[fmt],
)
backup_path = mirro.backup_original(original_path, original_content, backup_dir)
backup_path = mirro.backup_original(
original_path, original_content, backup_dir
)
assert backup_path.exists()
text = backup_path.read_text(encoding="utf-8")
@@ -140,7 +144,9 @@ def test_main_missing_argument(capsys):
with pytest.raises(SystemExit):
mirro.main()
assert "the following arguments are required: file" in capsys.readouterr().err
assert (
"the following arguments are required: file" in capsys.readouterr().err
)
# ============================================================