mirror of https://github.com/zulip/zulip.git
ruff: Enable PERF rules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
562a79ab76
commit
ca40e60469
|
@ -65,7 +65,7 @@ def generate_time_series_data(
|
||||||
seed(random_seed)
|
seed(random_seed)
|
||||||
noise_scalars = [gauss(0, 1)]
|
noise_scalars = [gauss(0, 1)]
|
||||||
for i in range(1, length):
|
for i in range(1, length):
|
||||||
noise_scalars.append(
|
noise_scalars.append( # noqa: PERF401 # https://github.com/astral-sh/ruff/issues/6210
|
||||||
noise_scalars[-1] * autocorrelation + gauss(0, 1) * (1 - autocorrelation)
|
noise_scalars[-1] * autocorrelation + gauss(0, 1) * (1 - autocorrelation)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,7 @@ select = [
|
||||||
"INT", # gettext
|
"INT", # gettext
|
||||||
"ISC", # string concatenation
|
"ISC", # string concatenation
|
||||||
"N", # naming
|
"N", # naming
|
||||||
|
"PERF", # performance
|
||||||
"PGH", # pygrep-hooks
|
"PGH", # pygrep-hooks
|
||||||
"PIE", # miscellaneous
|
"PIE", # miscellaneous
|
||||||
"PL", # pylint
|
"PL", # pylint
|
||||||
|
@ -139,6 +140,7 @@ ignore = [
|
||||||
"E731", # Do not assign a lambda expression, use a def
|
"E731", # Do not assign a lambda expression, use a def
|
||||||
"N802", # Function name should be lowercase
|
"N802", # Function name should be lowercase
|
||||||
"N806", # Variable in function should be lowercase
|
"N806", # Variable in function should be lowercase
|
||||||
|
"PERF203", # `try`-`except` within a loop incurs performance overhead
|
||||||
"PLC1901", # `s == ""` can be simplified to `not s` as an empty string is falsey
|
"PLC1901", # `s == ""` can be simplified to `not s` as an empty string is falsey
|
||||||
"PLR0911", # Too many return statements
|
"PLR0911", # Too many return statements
|
||||||
"PLR0912", # Too many branches
|
"PLR0912", # Too many branches
|
||||||
|
|
Loading…
Reference in New Issue