Skip to content

Commit b0ecd29

Browse files
authored
fix: exempt standalone E2E/data-loading scripts and forced bump (#20)
chore: exempt standalone scripts from C901; fix pre-commit hooks - pyproject.toml: add per-file C901 ignore for test-e2e.py and load-sample-data.py (standalone scripts where high CC is expected) - .pre-commit-config.yaml: remove language/types/require_serial overrides from ruff-check (let pre-commit manage its own env); fix reuse-lint entry to use system reuse binary directly instead of uv run --no-sync which targeted .venv where reuse was absent
1 parent ccb6e38 commit b0ecd29

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
2525
rev: v0.15.4
2626
hooks:
27-
- id: ruff
27+
- id: ruff-check
2828
args: [--fix, --exit-non-zero-on-fix]
2929
- id: ruff-format
3030

@@ -41,7 +41,7 @@ repos:
4141
hooks:
4242
- id: reuse-lint
4343
name: REUSE Compliance (SPDX headers)
44-
entry: uv run --no-sync --native-tls python3 -m reuse lint
44+
entry: reuse lint
4545
language: system
4646
pass_filenames: false
4747

pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ dev = [
2929
"pre-commit",
3030
"pytest",
3131
"pytest-django",
32+
"pytest-cov>=6.0",
3233
"python-semantic-release",
34+
"django>=6.0.2",
35+
"netaddr>=1.3.0",
36+
"psycopg>=3.3.3",
3337
]
3438
docs = [
3539
"mkdocs>=1,<2",
@@ -43,7 +47,7 @@ pythonpath = ["/opt/netbox/netbox"]
4347
line-length = 120
4448

4549
[tool.ruff.lint]
46-
select = ["E", "F", "D"]
50+
select = ["E", "F", "W", "D", "C901"]
4751
ignore = [
4852
"E501", # line too long (handled by formatter)
4953
"F403", # star imports
@@ -57,11 +61,17 @@ ignore = [
5761
"D213", # multi-line summary second line (conflicts with D212)
5862
]
5963

64+
[tool.ruff.lint.mccabe]
65+
# Flag errors (`C901`) whenever the complexity level exceeds 15.
66+
max-complexity = 15
67+
6068
[tool.ruff.lint.per-file-ignores]
6169
"__init__.py" = ["F401"]
6270
"*/migrations/*.py" = ["D"]
6371
"*/tests/*.py" = ["D"]
6472
".devcontainer/**" = ["D"]
73+
".devcontainer/scripts/test-e2e.py" = ["C901"]
74+
".devcontainer/scripts/load-sample-data.py" = ["C901"]
6575

6676
[tool.coverage.run]
6777
source = ["netbox_interface_name_rules"]

0 commit comments

Comments
 (0)