-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathpyproject.toml
183 lines (169 loc) · 4.45 KB
/
pyproject.toml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
[tool.ruff]
output-format = "grouped"
line-length = 120
target-version = "py37"
extend-exclude = [
"newrelic/packages/",
"setup.py",
"newrelic/core/infinite_tracing_*_pb2.py",
]
namespace-packages = ["testing_support"]
[tool.ruff.format]
skip-magic-trailing-comma = true
[tool.ruff.lint]
isort.split-on-trailing-comma=false
pep8-naming.extend-ignore-names = ["X", "y"]
select = [
# Enabled linters and rules
# "F", # Pyflakes
# "E", # pycodestyle
"W", # pycodestyle
"I", # isort
# "N", # pep8-naming
# "UP", # pyupgrade
"YTT", # flake8-2020
"ASYNC", # flake8-async
# "S", # flake8-bandit
# "BLE", # flake8-blind-except
# "FBT", # flake8-boolean-trap
# "B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
# "C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
# "EM", # flake8-errmsg
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"G", # flake8-logging-format
# "INP", # flake8-no-pep420
"PYI", # flake8-pyi
# "PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
# "RET", # flake8-return
# "SLF", # flake8-self
"SLOT", # flake8-slots
# "SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"INT", # flake8-gettext
# "ARG", # flake8-unused-arguments
# "PTH", # flake8-use-pathlib
"PGH", # pygrep-hooks
# "PL", # Pylint
# "TRY", # tryceratops
"FLY", # flynt
"PERF", # Perflint
"FURB", # refurb
# "RUF", # Ruff-specific rules
]
# Disabled Linters
# "ANN", # flake8-annotations
# "D", # pydocstyle
# "C90", # mccabe
# "DJ", # flake8-django
# "PIE", # flake8-pie
# "T20", # flake8-print
# "TC", # flake8-type-checking
# "TD", # flake8-todos
# "FIX", # flake8-fixme
# "ERA", # eradicate
# "PD", # pandas-vet
# "NPY", # NumPy-specific rules
# "FAST", # FastAPI
# "AIR", # Airflow
# Preview linters (disabled)
# "CPY", # flake8-copyright
# "DOC", # pydoclint
ignore = [
# Temporarily disabled rules
"RUF100", # unused-noqa (TODO: remove this once all linters are enabled)
"PERF203", # try-except-in-loop (most of these are unavoidable)
# Permanently disabled rules
"D203", # incorrect-blank-line-before-class
"D213", # multi-line-summary-second-line
"ARG001", # unused-argument
"PYI024", # collections-named-tuple (not currently using type annotations)
# Ruff recommended linter rules to disable when using formatter
"W191", # tab-indentation
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"D206", # docstring-tab-indentation
"D300", # triple-single-quotes
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
# Disabled rules in tests
"F401", # unused-import
"F811", # redefined-while-unused (pytest fixtures trigger this)
"PLR2004", # magic-value-comparison (comparing to constant values)
"S101", # assert (acceptable in tests)
"ASYNC251", # blocking-sleep-in-async-function (acceptable in tests)
]
# Alternate linters and formatters
[tool.black]
line-length = 120
include = '\.pyi?$'
[tool.isort]
profile = "black"
[tool.pylint.messages_control]
disable = [
"C0103",
"C0114",
"C0115",
"C0116",
"C0209",
"C0302",
"C0415",
"E0401",
"E1120",
"R0205",
"R0401",
"R0801",
"R0902",
"R0903",
"R0904",
"R0911",
"R0912",
"R0913",
"R0914",
"R0915",
"R1705",
"R1710",
"R1725",
"W0201",
"W0212",
"W0223",
"W0402",
"W0603",
"W0612",
"W0613",
"W0702",
"W0703",
"W0706",
"line-too-long",
"redefined-outer-name",
]
[tool.pylint.format]
max-line-length = "120"
[tool.pylint.basic]
good-names = "exc,val,tb"
[tool.bandit]
skips = ["B110", "B101", "B404"]
[tool.flynt]
line-length = 999999
aggressive = true
transform-concats = true
transform-joins = true
exclude = ["newrelic/packages/", "setup.py"]
# setup.py needs to not immediately crash on Python 2 to log error messages, so disable fstrings