-
-
Notifications
You must be signed in to change notification settings - Fork 656
Expand file tree
/
Copy pathruff.toml
More file actions
97 lines (93 loc) · 4.6 KB
/
Copy pathruff.toml
File metadata and controls
97 lines (93 loc) · 4.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Shared Ruff config for all Nest Python (backend, docs, infrastructure).
# Used by dockerized/CI pre-commit via: --config ruff.toml
# Keep paths repo-relative so resolution works under /nest and on the host.
target-version = "py313"
line-length = 99
src = [
"backend/src",
"backend/tests",
"docs",
".github/scripts",
"infrastructure/scripts",
"infrastructure/tests",
"tools/security",
"tools/tests",
]
[lint]
select = ["ALL"]
extend-select = ["I"]
ignore = [
"ANN", # https://docs.astral.sh/ruff/rules/#flake8-annotations-ann/
"ARG002", # https://docs.astral.sh/ruff/rules/unused-method-argument/
"C901", # https://docs.astral.sh/ruff/rules/complex-structure/
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/
"D203", # conflicts with D211; https://docs.astral.sh/ruff/rules/one-blank-line-before-class/
"D213", # conflicts with D212; https://docs.astral.sh/ruff/rules/multi-line-summary-second-line/
"D407", # https://docs.astral.sh/ruff/rules/missing-dashed-underline-after-section/
"DJ012", # https://docs.astral.sh/ruff/rules/django-unordered-body-content-in-model/
"FIX002", # https://docs.astral.sh/ruff/rules/line-contains-todo/
"PLR0912", # https://docs.astral.sh/ruff/rules/too-many-branches/
"PLR0913", # https://docs.astral.sh/ruff/rules/too-many-arguments/
"PLR0915", # https://docs.astral.sh/ruff/rules/too-many-statements/
"RUF012", # https://docs.astral.sh/ruff/rules/mutable-class-default/
"TD003", # https://docs.astral.sh/ruff/rules/missing-todo-link/
]
[lint.per-file-ignores]
"**/__init__.py" = [
"D104", # https://docs.astral.sh/ruff/rules/undocumented-public-package/
"F401", # https://docs.astral.sh/ruff/rules/unused-import/
]
"**/tests/**/*.py" = [
"D100", # https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D101", # https://docs.astral.sh/ruff/rules/undocumented-public-class/
"D102", # https://docs.astral.sh/ruff/rules/undocumented-public-method/
"D103", # https://docs.astral.sh/ruff/rules/undocumented-public-function/
"D106", # https://docs.astral.sh/ruff/rules/undocumented-public-nested-class/
"D107", # https://docs.astral.sh/ruff/rules/undocumented-public-init/
"FBT001", # https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/
"INP001", # https://docs.astral.sh/ruff/rules/implicit-namespace-package/
"PLR2004", # https://docs.astral.sh/ruff/rules/magic-value-comparison/
"RUF012", # https://docs.astral.sh/ruff/rules/mutable-class-default/
"S101", # https://docs.astral.sh/ruff/rules/assert/
"SLF001", # https://docs.astral.sh/ruff/rules/private-member-access/
"TC002", # https://docs.astral.sh/ruff/rules/typing-only-third-party-import/
"TC003", # https://docs.astral.sh/ruff/rules/typing-only-standard-library-import/
]
"backend/src/apps/**/management/commands/*.py" = [
"D101", # https://docs.astral.sh/ruff/rules/undocumented-public-class/
"D102", # https://docs.astral.sh/ruff/rules/undocumented-public-method/
"SLF001", # https://docs.astral.sh/ruff/rules/private-member-access/
]
"backend/src/apps/**/migrations/*.py" = [
"ARG001", # https://docs.astral.sh/ruff/rules/unused-function-argument/
"D100", # https://docs.astral.sh/ruff/rules/undocumented-public-module/
"D101", # https://docs.astral.sh/ruff/rules/undocumented-public-class/
"D103", # https://docs.astral.sh/ruff/rules/undocumented-public-function/
"D104", # https://docs.astral.sh/ruff/rules/undocumented-public-package/
"E501", # https://docs.astral.sh/ruff/rules/line-too-long/
"RUF012", # https://docs.astral.sh/ruff/rules/mutable-class-default/
]
"backend/src/apps/api/rest/**/*.py" = [
"ARG001", # https://docs.astral.sh/ruff/rules/unused-function-argument/
"B008", # https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
]
"backend/src/apps/github/models/mixins/*.py" = ["PLC0415"]
"backend/src/apps/slack/commands/*.py" = ["PLC0415"]
"backend/src/apps/slack/common/handlers/*.py" = ["PLC0415"]
"backend/src/apps/slack/events/**/*.py" = ["PLC0415"]
"backend/src/settings/*.py" = [
"RUF012", # https://docs.astral.sh/ruff/rules/mutable-class-default/
]
"backend/tests/cluster-fuzz-lite/**/*.py" = [
"INP001", # Atheris fuzz harnesses mirror production paths; not importable packages.
]
".github/scripts/*.py" = [
"INP001", # Standalone CI scripts; not importable packages.
]
"tools/security/*.py" = [
"INP001", # Standalone maintainer scripts; not importable packages.
]
[lint.isort]
detect-same-package = false
known-first-party = ["apps", "docker_compose_check", "renew_security_txt", "scripts", "serve", "tests"]
known-third-party = ["github"]