Skip to content

Commit 5fd795e

Browse files
committed
Fix ruff config in linting files
1 parent 4f8c3bd commit 5fd795e

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.ruff.toml renamed to .github/linters/.ruff.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ ignore = [
2525
"TD003", # Ignore Missing issue link in TODOs (often not required/available)
2626
"T201", # Ignore print presence
2727
"RUF012", # Ignore Mutable class attributes should be annotated with `typing.ClassVar`
28+
"E501", # Ignore line length (handled by Ruff's dynamic line length)
29+
"ANN002",
30+
"ANN003",
2831
]
2932

3033
select = [
@@ -77,6 +80,7 @@ exclude = [
7780
"node_modules",
7881
"venv",
7982
"*/migrations/*",
83+
"test_*",
8084
]
8185

8286
[lint.isort]
@@ -134,6 +138,7 @@ inline-quotes = "single"
134138
"types.py" = ["D", "E501", "N815"] # Ignore docstring and annotation issues in types.py
135139

136140
[format]
141+
exclude = ["types.py"]
137142
docstring-code-format = true
138143
docstring-code-line-length = "dynamic" # Or set to 80
139144
quote-style = "single"

.github/workflows/linter.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ jobs:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454
LOG_LEVEL: WARN
5555
SHELLCHECK_OPTS: -e SC1091 -e 2086
56-
VALIDATE_ALL_CODEBASE: true
5756
VALIDATE_PYTHON_BLACK: false
5857
VALIDATE_PYTHON_FLAKE8: false
5958
VALIDATE_PYTHON_ISORT: false

.vscode/settings.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,16 @@
77
"editor.defaultFormatter": "charliermarsh.ruff",
88
"editor.formatOnSave": true,
99
"editor.codeActionsOnSave": {
10-
"source.organizeImports": "always"
10+
"source.fixAll.ruff": "explicit"
1111
}
1212
},
13-
"ruff.importStrategy": "fromEnvironment"
13+
"ruff.importStrategy": "fromEnvironment",
14+
"ruff.lint.args": [
15+
"--config",
16+
".github/linters/.ruff.toml"
17+
],
18+
"ruff.format.args": [
19+
"--config",
20+
".github/linters/.ruff.toml"
21+
]
1422
}

noxfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737

3838
@nox.session(python=DEFAULT_PYTHON_VERSION)
39-
def format(session):
39+
def format(session) -> None:
4040
"""Format Python code using autoflake, pyupgrade, and ruff."""
4141
# Sort Spelling Allowlist
4242
spelling_allow_file = '.github/actions/spelling/allow.txt'
@@ -141,10 +141,14 @@ def format(session):
141141
'ruff',
142142
'check',
143143
'--fix-only',
144+
'--config',
145+
'.github/linters/.ruff.toml',
144146
*lint_paths_py,
145147
)
146148
session.run(
147149
'ruff',
148150
'format',
151+
'--config',
152+
'.github/linters/.ruff.toml',
149153
*lint_paths_py,
150154
)

0 commit comments

Comments
 (0)