Skip to content

Commit 4d5289c

Browse files
authored
fix: pc check skipped incorrectly (#767)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 20588b4 commit 4d5289c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/sp_repo_review/checks/precommit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def check(precommit: dict[str, Any], dependabot: dict[str, Any]) -> bool | None:
218218
```
219219
"""
220220
if any(
221-
ecosystem.get("package-ecosystem", "") == "github-actions"
221+
ecosystem.get("package-ecosystem", "") == "pre-commit"
222222
for ecosystem in dependabot.get("updates", [])
223223
):
224224
return None
@@ -240,7 +240,7 @@ def check(precommit: dict[str, Any], dependabot: dict[str, Any]) -> bool | None:
240240
```
241241
"""
242242
if any(
243-
ecosystem.get("package-ecosystem", "") == "github-actions"
243+
ecosystem.get("package-ecosystem", "") == "pre-commit"
244244
for ecosystem in dependabot.get("updates", [])
245245
):
246246
return None
@@ -262,7 +262,7 @@ def check(precommit: dict[str, Any], dependabot: dict[str, Any]) -> bool | None:
262262
```
263263
"""
264264
if any(
265-
ecosystem.get("package-ecosystem", "") == "github-actions"
265+
ecosystem.get("package-ecosystem", "") == "pre-commit"
266266
for ecosystem in dependabot.get("updates", [])
267267
):
268268
return None

tests/test_precommit.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def test_pc901():
290290
def test_pc901_not_needed():
291291
dependabot = yaml.safe_load("""
292292
updates:
293-
- package-ecosystem: "github-actions"
293+
- package-ecosystem: "pre-commit"
294294
""")
295295
assert compute_check("PC901", precommit={}, dependabot=dependabot).result is None
296296

@@ -324,7 +324,7 @@ def test_pc902_no_msg():
324324
def test_pc902_not_needed():
325325
dependabot = yaml.safe_load("""
326326
updates:
327-
- package-ecosystem: "github-actions"
327+
- package-ecosystem: "pre-commit"
328328
""")
329329
assert compute_check("PC902", precommit={}, dependabot=dependabot).result is None
330330

@@ -350,13 +350,13 @@ def test_pc903_no_msg():
350350
def test_pc903_not_needed():
351351
dependabot = yaml.safe_load("""
352352
updates:
353-
- package-ecosystem: "github-actions"
353+
- package-ecosystem: "pre-commit"
354354
""")
355355
assert compute_check("PC903", precommit={}, dependabot=dependabot).result is None
356356

357357

358358
def test_repo_review_checks_skips_with_lefthook_only(tmp_path: Path) -> None:
359-
"""PreCommit checks should be omitted if only lefthook.yml is present.
359+
"""Precommit checks should be omitted if only lefthook.yml is present.
360360
361361
When a repository uses `lefthook.yml` and does not have a
362362
`.pre-commit-config.yaml`, `repo_review_checks` should return an empty

0 commit comments

Comments
 (0)