-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
E131: indent_chances overwritten #972
base: main
Are you sure you want to change the base?
Conversation
pycodestyle.py
Outdated
@@ -706,6 +706,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, | |||
# ignore token lined up with matching one from a | |||
# previous line | |||
pass | |||
elif isinstance(visual_indent, list) and text in visual_indent: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm so now this variable can be None, True, False, bytes, str, or a list of str? this seems like we're trying to do too much with dynamicism here -- is there any way to make this easier to understand than overloading the type further?
pycodestyle.py
Outdated
@@ -778,6 +780,13 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing, | |||
if start[1] not in indent_chances: | |||
# allow lining up tokens | |||
indent_chances[start[1]] = text | |||
else: | |||
v = indent_chances[start[1]] | |||
if not isinstance(v, (bool, type(None))): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather see:
if list:
...
elif str / bytes:
...
are all of these branches covered by your tests?
Relates to #953