Skip to content

Commit 929dce1

Browse files
committed
chore: exempt standalone E2E/data-loading scripts from C901 complexity check
1 parent ccb6e38 commit 929dce1

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ 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]
29+
language: system
30+
types: [python]
31+
require_serial: true
2932
- id: ruff-format
3033

3134
# Conventional commit message validation

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)