mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00

## Summary By using `set`, we were setting the bracket flag to `false` if another operator was visited. Closes https://github.com/astral-sh/ruff/issues/8379. ## Test Plan `cargo test`
30 lines
620 B
Python
30 lines
620 B
Python
#: E211
|
|
spam (1)
|
|
#: E211 E211
|
|
dict ['key'] = list [index]
|
|
#: E211
|
|
dict['key'] ['subkey'] = list[index]
|
|
#: Okay
|
|
spam(1)
|
|
dict['key'] = list[index]
|
|
|
|
|
|
# This is not prohibited by PEP8, but avoid it.
|
|
class Foo (Bar, Baz):
|
|
pass
|
|
|
|
|
|
def fetch_name () -> Union[str, None]:
|
|
"""Fetch name from --person-name in sys.argv.
|
|
|
|
Returns:
|
|
name of the person if available, otherwise None
|
|
"""
|
|
test = len(5)
|
|
Logger.info(test)
|
|
# test commented code
|
|
# Logger.info("test code")
|
|
for i in range (0, len (sys.argv)) :
|
|
if sys.argv[i] == "--name" :
|
|
return sys.argv[i + 1]
|
|
return None
|