Skip to content

Instantly share code, notes, and snippets.

@shidarin
Last active August 29, 2015 14:01
Show Gist options
  • Save shidarin/06e59191ab0c7f26c1c3 to your computer and use it in GitHub Desktop.
Save shidarin/06e59191ab0c7f26c1c3 to your computer and use it in GitHub Desktop.
Hanging Indent Issues with PyLint 0.2.1
import argparse
def parse_args():
parser = argparse.ArgumentParser()
# No trigger
parser.add_argument(
"no indent",
help="this isn't going to have an indent"
)
# No trigger
parser.add_argument(
"line continued indent",
help="Of course the irony of the line continuation is that my IDE " \
"now complains about the unneeded \\"
)
# No trigger
parser.add_argument(
"this seems to what 1.2.1 wants",
help="this doesn't help distinguish between multiple arguments on"
"multiple lines. It looks messing, it's hard to figure out, and "
"it doesn't contribute to readable code."
)
# Triggers in 1.2.1
parser.add_argument(
"now broken in 1.2.1",
help="this type of indent with no \\ is now disallowed in 1.2.1, "
"despite it's pleasing looks and lack of superfluous slashes."
)
# Triggers in 1.2.1 (and probably should)
parser.add_argument(
"what about different spacing",
help="let's try a line contunuation with a strict 4 space continuation"
"like this."
)
@shidarin
Copy link
Author

shidarin commented May 5, 2014

This triggers the following errors for me in pylint 1.2.1:

C: 28, 0: Wrong hanging indentation.
             "despite it's pleasing looks and lack of superfluous slashes."
        |    ^ (bad-continuation)
C: 34, 0: Wrong hanging indentation.
            "like this."
        |   ^ (bad-continuation)
C:  1, 0: Missing module docstring (missing-docstring)
C:  4, 0: Missing function docstring (missing-docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment