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)
|
||||
noise_scalars = [gauss(0, 1)]
|
||||
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)
|
||||
)
|
||||
|
||||
|
|
|
@ -108,6 +108,7 @@ select = [
|
|||
"INT", # gettext
|
||||
"ISC", # string concatenation
|
||||
"N", # naming
|
||||
"PERF", # performance
|
||||
"PGH", # pygrep-hooks
|
||||
"PIE", # miscellaneous
|
||||
"PL", # pylint
|
||||
|
@ -139,6 +140,7 @@ ignore = [
|
|||
"E731", # Do not assign a lambda expression, use a def
|
||||
"N802", # Function name 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
|
||||
"PLR0911", # Too many return statements
|
||||
"PLR0912", # Too many branches
|
||||
|
|
Loading…
Reference in New Issue