-
Notifications
You must be signed in to change notification settings - Fork 890
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
hanging indent and pylint (PEP8) #769
Comments
The documentation explains that this is because |
Can you please point me to the documentation for I tried (So, I still haven't figured out how to get PEP8-style extra indentation for continued if statements and continued function definitions.) |
Search for "CONTINUATION_ALIGN_STYLE" in Again, with use_tabs=False the option simply does not work, as documented. Set use_tabs to True to see what the option does. There is a difference between PEP8-style continuations (aligned with bracket on previous row) and the continuations suggested by pylint (indented with one extra indent). The latter style looks as follows: if (node.children[0].type == token.AWAIT or
(node.children[0].type == token.NAME and xcast(Leaf, node.children[0]).value == 'await')):
atom_child, *trailer_factor_children = node.children[1:] And def _as_prolog_str_full(
value: Union[PlainOldData, List[Any], bool, str, int, Dict[Any, Any], None, Exception]) -> str:
"""Recursively turn an object into a Prolog term.""" |
I've read that section a dozen times and I simply cannot understand it. :( The examples of PEP8 indentation seem to show the same style that pylint wants, and which pytype doesn't do (at least, it doesn't do with |
I agree, that sentence does not look grammatical and it's weird that this combination of options is not available. You're right, PEP8 discusses three possible continuation styles. My favorite is to always stick to the second one (indent with one extra level of indentation, to clearly separate continuation from regular indentation). |
@gwelymernans - Does it make sense to add another @yinyin - Could you please fix the sentence "For options |
@kamahen I made a PR to enable At the time I add the knob, I did not aware this option is useful for indentation with spaces. |
Sorry for missing this. Let me look into this to see if there's a fix I can quickly apply. |
pylint doesn't like this indentation -- the 2nd line should be indented an additional 4 spaces:
I couldn't see any option for setting hanging indent --
continuation_indent_width
doesn't do what I want.Here's another example that pylint doesn't like -- the 2nd line should be indented an additional 4 spaces:
The text was updated successfully, but these errors were encountered: