Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/sp_repo_review/checks/precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def check(precommit: dict[str, Any], dependabot: dict[str, Any]) -> bool | None:
```
"""
if any(
ecosystem.get("package-ecosystem", "") == "github-actions"
ecosystem.get("package-ecosystem", "") == "pre-commit"
for ecosystem in dependabot.get("updates", [])
):
return None
Expand All @@ -240,7 +240,7 @@ def check(precommit: dict[str, Any], dependabot: dict[str, Any]) -> bool | None:
```
"""
if any(
ecosystem.get("package-ecosystem", "") == "github-actions"
ecosystem.get("package-ecosystem", "") == "pre-commit"
for ecosystem in dependabot.get("updates", [])
):
return None
Expand All @@ -262,7 +262,7 @@ def check(precommit: dict[str, Any], dependabot: dict[str, Any]) -> bool | None:
```
"""
if any(
ecosystem.get("package-ecosystem", "") == "github-actions"
ecosystem.get("package-ecosystem", "") == "pre-commit"
for ecosystem in dependabot.get("updates", [])
):
return None
Expand Down
8 changes: 4 additions & 4 deletions tests/test_precommit.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def test_pc901():
def test_pc901_not_needed():
dependabot = yaml.safe_load("""
updates:
- package-ecosystem: "github-actions"
- package-ecosystem: "pre-commit"
""")
assert compute_check("PC901", precommit={}, dependabot=dependabot).result is None

Expand Down Expand Up @@ -324,7 +324,7 @@ def test_pc902_no_msg():
def test_pc902_not_needed():
dependabot = yaml.safe_load("""
updates:
- package-ecosystem: "github-actions"
- package-ecosystem: "pre-commit"
""")
assert compute_check("PC902", precommit={}, dependabot=dependabot).result is None

Expand All @@ -350,13 +350,13 @@ def test_pc903_no_msg():
def test_pc903_not_needed():
dependabot = yaml.safe_load("""
updates:
- package-ecosystem: "github-actions"
- package-ecosystem: "pre-commit"
""")
assert compute_check("PC903", precommit={}, dependabot=dependabot).result is None


def test_repo_review_checks_skips_with_lefthook_only(tmp_path: Path) -> None:
"""PreCommit checks should be omitted if only lefthook.yml is present.
"""Precommit checks should be omitted if only lefthook.yml is present.

When a repository uses `lefthook.yml` and does not have a
`.pre-commit-config.yaml`, `repo_review_checks` should return an empty
Expand Down
Loading