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

indent block comments but remove comment-indentation #969

Open
spaceone opened this issue Oct 7, 2021 · 3 comments · May be fixed by #1005
Open

indent block comments but remove comment-indentation #969

spaceone opened this issue Oct 7, 2021 · 3 comments · May be fixed by #1005

Comments

@spaceone
Copy link

spaceone commented Oct 7, 2021

[style]
based_on_style=pep8
use_tabs=True

transforms:

class Foo(object):
»   def __init__(self):
»   #»  pass
»   »   pass

into:

class Foo(object):
»   def __init__(self):
»   »   #»  pass
»   »   pass

I think (wrong indented) block comments should be indented, but the indentation in the comment should be removed.
So that we get:

class Foo(object):
»   def __init__(self):
»   »   # pass
»   »   pass
@jcipa jcipa linked a pull request Apr 21, 2022 that will close this issue
@bwendling
Copy link
Member

I'm not sure I agree with this. A person who has a specific formatting in a comment probably did it that way for a reason. For instance, you could have something like:

# This is a comment that has an example:
#    This is the example that I want indented.
# The last line of the comment.

@spaceone
Copy link
Author

but it is not PEP8 conform. you can stil have unchanged indentation via # \t which I pretty often use.

@Spitfire1900
Copy link
Contributor

I'm not sure I agree with this. A person who has a specific formatting in a comment probably did it that way for a reason. For instance, you could have something like:


# This is a comment that has an example:

#    This is the example that I want indented.

# The last line of the comment.

I use this personally for things like pydocs when an argument's documentation extends beyond the linter(s) defined length limit.

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 a pull request may close this issue.

3 participants