Skip to content

Commit d4c7ba6

Browse files
committed
fix: ensure PC191 doesn't trigger for flake8
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent 947a1ad commit d4c7ba6

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/sp_repo_review/checks/precommit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ def check( # type: ignore[override]
173173
return "--show-fixes" in hook["args"] or (
174174
ruff is not None and "show-fixes" in ruff
175175
)
176-
return None
177-
return False
176+
return None
178177

179178

180179
class PC192(PreCommit):

tests/test_precommit.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ def test_pc191_no_show_fixes(ruff_check: str, ruffconfig):
246246
assert "--show-fixes" in res.err_msg
247247

248248

249+
def test_pc191_no_ruff():
250+
precommit = yaml.safe_load("""
251+
repos:
252+
- repo: https://github.com/pycqa/flake8
253+
""")
254+
res = compute_check("PC191", precommit=precommit, ruff={})
255+
assert res.result is None
256+
257+
249258
def test_pc192():
250259
precommit = yaml.safe_load("""
251260
repos:

0 commit comments

Comments
 (0)