-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
145 lines (138 loc) · 3.4 KB
/
ruff.toml
File metadata and controls
145 lines (138 loc) · 3.4 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
line-length = 79
target-version = "py312" # Default python version
[lint]
# To test and work on: eradicate (ERA) - we need to work on it to be able to keep some comments.
# To activate later: 'SIM', 'PTH', 'PLR', 'G', 'ARG', 'PLW2901'
select = [
'F', # Pyflakes
'E', # Error
'W', # Warning
'I', # Isort
'UP', # pyupgrade
'YTT', # flake8-2020 (usage of sys package)
'S101', # assert used (ignored for tests, see below)
'S110', # try-except-pass detected, consider logging the exception
'B', # flake8-bugbear
# 'A', we often have models with id, list, etc.
# 'COM', conflicts with black
'C4', # flake8-comprehensions
'T10', # flake8-debugger
# 'DJ', null TextField, no __str__ on model
'EXE', # flake8-executable
'FA', # flake8-future-annotations
'ISC', # flake8-implicit-str-concat
'PIE', # flake8-pie (misc lints)
'T20', # flake8-print
'PT', # flake8-pytest-style
# 'Q', redundant with black
'RSE', # flake8-raise
'RET', # flake8-return
#'SLF', we use model._meta too often
'PLE', # pylint ('E' subset)
'PLW', # pylint ('W' subset)
'FLY', # static join to f-string
'RUF', # ruff miscellanous lints
]
exclude = ["/*with_errors*", "/**/.venv"]
ignore = [
"E501", # line too long
"E402", # module level import not at top of file
"B904", # raise-without-from-inside-except
"RET505", # superfluous else return
"PLW2901", # redefined loop name
"RUF012", # mutable class default
"B017", # pytest.raises exception considered evil
"PT011", # pytest.raises too broad
# conflicts with ruff formatter
"W191",
"E111",
"E114",
"E117",
"ISC001",
"ISC002",
]
[lint.per-file-ignores]
# The pre-file-ignores paths are resolved relative to
# the location of ruff.toml!
# See https://github.com/astral-sh/ruff/issues/6480
"/**/test/**" = ["S101"]
"/**/tests/**" = ["S101"]
"/**/conftest.py" = ["S101"]
"/**/pytest_plugin.py" = ["S101"]
"/**/test_*.py" = ["S101"]
[lint.isort]
lines-after-imports = 2
lines-between-types = 0
section-order = [
"future",
"standard-library",
"django",
"drf",
"aws",
"azure",
"third-party",
"first-party",
"project",
"divio",
"local-folder",
]
known-first-party = ["conftest", "test_utils", "version"] # Control Panel
[lint.isort.sections]
django = ["django", "django_extensions"]
drf = ["rest_framework"]
aws = ["boto3", "botocore"]
azure = ["azure", "msrestazure"]
divio = ["divio"]
project = [
# Services API
"services",
# App Controller
"app_controller",
# Control Panel
"accounts",
"annotations",
"api",
"apps",
"asynchronous_tasks",
"backups",
"backing_services",
"baseproject",
"billing",
"boilerplates",
"bundle_io",
"celeryapp",
"commandcenter",
"control",
"cronjobs",
"currencies",
"dbapi",
"demo",
"deploy",
"domains",
"god",
"google_api",
"graphql_tests",
"harvest_api",
"harvest_export",
"http_callbacks",
"impersonate",
"intercom_api",
"licenses",
"login",
"login_saml",
"maintenance",
"network",
"notifications",
"product_changes",
"project",
"project_creation",
"repositories",
"s3_storage",
"sharing",
"statistics",
"statistics_reporting",
"tests",
"tracking",
"tutorial",
"tweet",
]