Enable ruff PLW0120 rule (#11330)

Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Maxim Smolskiy 2024-03-28 20:28:54 +03:00 committed by GitHub
parent da47d5c88c
commit efb7463cde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 5 deletions

View File

@ -11,7 +11,6 @@ lint.ignore = [ # `ruff rule S101` for a description of that rule
"NPY002", # Replace legacy `np.random.choice` call with `np.random.Generator` -- FIX ME
"PGH003", # Use specific rule codes when ignoring type issues -- FIX ME
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
"PLW0120", # `else` clause on loop without a `break` statement -- FIX ME
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception

View File

@ -123,7 +123,6 @@ def fibonacci_search(arr: list, val: int) -> int:
elif val > item_k_1:
offset += fibonacci(fibb_k - 1)
fibb_k -= 2
else:
return -1

View File

@ -106,7 +106,6 @@ def ite_ternary_search(array: list[int], target: int) -> int:
else:
left = one_third + 1
right = two_third - 1
else:
return -1