Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

andribas404
Copy link

Relates to #953

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:
Copy link
Member

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))):
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants