Skip to content

Commit 72ccb34

Browse files
authored
Fix ecosystem check for indico (#10164)
1 parent dcc92f5 commit 72ccb34

File tree

1 file changed

+62
-6
lines changed

1 file changed

+62
-6
lines changed

python/ruff-ecosystem/ruff_ecosystem/defaults.py

+62-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"""
44
from ruff_ecosystem.projects import (
55
CheckOptions,
6-
ConfigOverrides,
76
FormatOptions,
87
Project,
98
Repository,
@@ -55,11 +54,6 @@
5554
Project(repo=Repository(owner="pypa", name="pip", ref="main")),
5655
Project(
5756
repo=Repository(owner="pypa", name="setuptools", ref="main"),
58-
# Since `setuptools` opts into the "preserve" quote style which
59-
# require preview mode, we must disable it during the `--no-preview` run
60-
config_overrides=ConfigOverrides(
61-
when_no_preview={"format.quote-style": "double"}
62-
),
6357
),
6458
Project(repo=Repository(owner="python", name="mypy", ref="master")),
6559
Project(
@@ -99,6 +93,68 @@
9993
),
10094
Project(
10195
repo=Repository(owner="indico", name="indico", ref="master"),
96+
# Remove once indico removed S401 from their ignore configuration
97+
config_overrides={
98+
"lint.ignore": [
99+
"E226", # allow omitting whitespace around arithmetic operators
100+
"E731",
101+
# allow assigning lambdas (it's useful for single-line functions defined inside other functions)
102+
"N818", # not all our exceptions are errors
103+
"RUF012", # ultra-noisy and dicts in classvars are very common
104+
"RUF015", # not always more readable, and we don't do it for huge lists
105+
"RUF022", # autofix messes up out formatting instead of just sorting
106+
"RUF027", # also triggers on i18n functions -> too noisy for now
107+
"D205", # too many docstrings which have no summary line
108+
"D301", # https://github.com/astral-sh/ruff/issues/8696
109+
"D1", # we have way too many missing docstrings :(
110+
"D401", # too noisy (but maybe useful to go through at some point)
111+
"D412", # we do not use section, and in click docstrings those blank lines are useful
112+
"S101", # we use asserts outside tests, and do not run python with `-O` (also see B011)
113+
"S113", # enforcing timeouts would likely require config in some places - maybe later
114+
"S311", # false positives, it does not care about the context
115+
"S324", # all our md5/sha1 usages are for non-security purposes
116+
"S404", # useless, triggers on *all* subprocess imports
117+
"S403", # there's already a warning on using pickle, no need to have one for the import
118+
"S405", # we don't use lxml in unsafe ways
119+
"S603", # useless, triggers on *all* subprocess calls: https://github.com/astral-sh/ruff/issues/4045
120+
"S607", # we trust the PATH to be sane
121+
"B011", # we don't run python with `-O` (also see S101)
122+
"B904", # possibly useful but too noisy
123+
"COM812", # trailing commas on multiline lists are nice, but we have 2.5k violations
124+
"PIE807", # `lambda: []` is much clearer for `load_default` in schemas
125+
"PT004", # pretty weird + not a pytest convention: https://github.com/astral-sh/ruff/issues/8796
126+
"PT005", # ^ likewise
127+
"PT011", # very noisy
128+
"PT015", # nice for tests but not so nice elsewhere
129+
"PT018", # ^ likewise
130+
"SIM102", # sometimes nested ifs are more readable
131+
"SIM103", # sometimes this is more readable (especially when checking multiple conditions)
132+
"SIM105", # try-except-pass is faster and people are used to it
133+
"SIM108", # noisy ternary
134+
"SIM114", # sometimes separate ifs are more readable (especially if they just return a bool)
135+
"SIM117", # nested context managers may be more readable
136+
"PLC0415", # local imports are there for a reason
137+
"PLC2701", # some private imports are needed
138+
"PLR09", # too-many-<whatever> is just noisy
139+
"PLR0913", # very noisy
140+
"PLR2004", # extremely noisy and generally annoying
141+
"PLR6201", # sets are faster (by a factor of 10!) but it's noisy and we're in nanoseconds territory
142+
"PLR6301", # extremely noisy and generally annoying
143+
"PLW0108", # a lambda often makes it more clear what you actually want
144+
"PLW1510", # we often do not care about the status code of commands
145+
"PLW1514", # we expect UTF8 environments everywhere
146+
"PLW1641", # false positives with SA comparator classes
147+
"PLW2901", # noisy and reassigning to the loop var is usually intentional
148+
"TRY002", # super noisy, and those exceptions are pretty exceptional anyway
149+
"TRY003", # super noisy and also useless w/ werkzeugs http exceptions
150+
"TRY300", # kind of strange in many cases
151+
"TRY301", # sometimes doing that is actually useful
152+
"TRY400", # not all exceptions need exception logging
153+
"PERF203", # noisy, false positives, and not applicable for 3.11+
154+
"FURB113", # less readable
155+
"FURB140", # less readable and actually slower in 3.12+
156+
]
157+
},
102158
),
103159
# Jupyter Notebooks
104160
Project(

0 commit comments

Comments
 (0)