Skip to content

Commit d968a77

Browse files
authored
chore: add pylint to CI and fix issues (#547)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 07b8590 commit d968a77

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.github/workflows/reusable-rr-tests.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,14 @@ jobs:
6363
run: |
6464
pipx run nox -s readme
6565
git diff --exit-code
66+
67+
pylint:
68+
name: Run pylint
69+
runs-on: ubuntu-latest
70+
steps:
71+
- uses: actions/checkout@v4
72+
with:
73+
fetch-depth: 0
74+
75+
- name: Run pylint
76+
run: pipx run nox[uv] -s rr_pylint -- --output-format=github

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.0
1+
3.4.1

src/sp_repo_review/_compat/importlib/resources/abc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import sys
44

55
if sys.version_info < (3, 11):
6+
# pylint: disable-next=deprecated-class
67
from importlib.abc import Traversable
78
else:
89
from importlib.resources.abc import Traversable

src/sp_repo_review/checks/pyproject.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def check(pyproject: dict[str, Any], package: Traversable) -> bool | None:
8383

8484
setup_cfg = package / "setup.cfg"
8585
if setup_cfg.is_file():
86+
# pylint: disable-next=import-outside-toplevel
8687
import configparser
8788

8889
config = configparser.ConfigParser()
@@ -134,7 +135,7 @@ def check(pyproject: dict[str, Any]) -> bool:
134135
options = pyproject["tool"]["pytest"]["ini_options"]
135136
return (
136137
"minversion" in options
137-
and int(str(options["minversion"]).split(".")[0]) >= 6
138+
and int(str(options["minversion"]).split(".", maxsplit=1)[0]) >= 6
138139
)
139140

140141

src/sp_repo_review/families.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class Family(typing.TypedDict, total=False):
1616
description: str # Defaults to empty
1717

1818

19-
def get_families(
20-
pyproject: dict[str, Any] = {}, # noqa: B006
21-
) -> dict[str, Family]:
19+
def get_families(pyproject: dict[str, Any]) -> dict[str, Family]:
2220
pyproject_description = f"- Detected build backend: `{pyproject.get('build-system', {}).get('build-backend', 'MISSING')}`"
2321
if classifiers := pyproject.get("project", {}).get("classifiers", []):
2422
licenses = [

0 commit comments

Comments
 (0)