A tab-indented .py file begins with a docstring that is not indented, but the content of the string is indented using spaces to get some disclaimers and license information to line up. E.g.,
"""
<Some text>
<arbitrary number of spaces>Some boilerplate text
"""
This causes the first tab-indented statement in the file to be flagged by pycodestyle as having inconsistent indentation.
def foo:
<tab>foo=bar() <--- This line is flagged as having inconsistent indentation
Pylint will ignore this by setting the indentation type manually in .pylintrc:
indent-string='\t'
Which causes pylint to not complain about the first indented line (because it knows that tabs are expected) any still complain about code that has been inadvertently indented with spaces.
I don't see a similar setting for pycodestyle, which causes my IDE to flag the "issue" even though pylint will ignore it. Obviously, this is cosmetic but it would be nice to be able to have both tools behave the same to avoid some unwitting developer reformat the entire legacy code base.
Is there a way to force pycodestyle to use tab indentation, instead of inferring it?
A tab-indented .py file begins with a docstring that is not indented, but the content of the string is indented using spaces to get some disclaimers and license information to line up. E.g.,
This causes the first tab-indented statement in the file to be flagged by pycodestyle as having inconsistent indentation.
Pylint will ignore this by setting the indentation type manually in .pylintrc:
Which causes pylint to not complain about the first indented line (because it knows that tabs are expected) any still complain about code that has been inadvertently indented with spaces.
I don't see a similar setting for pycodestyle, which causes my IDE to flag the "issue" even though pylint will ignore it. Obviously, this is cosmetic but it would be nice to be able to have both tools behave the same to avoid some unwitting developer reformat the entire legacy code base.
Is there a way to force pycodestyle to use tab indentation, instead of inferring it?