autopep8
autopep8 copied to clipboard
Doesn't seem to support tabs properly.
I am modifying autopep8 and pycodestyle to work with another programming language that is very similar to python. However, the style guide for this other language is that it should use tabs.
I modified pycodestyle to use tabs by modifying "indent_char" to a '\t'.
In autopep8, I saw the lines:
if indent_char != '\t' else (DEFAULT_INDENT_SIZE,
2 * DEFAULT_INDENT_SIZE)
)
And thought this meant it would read the indent character from pycodestyle.
However, upon execution, it always completely overwrites the tabs with spaces.
This issue https://github.com/jorgenschaefer/elpy/issues/680 seems to suggest it should work. A similar issue is already reported here https://github.com/hhatto/autopep8/issues/207 where they suggest using --ignore=E101,E111
but this disables all reindentation (ie an incorrectly indented line is not fixed).
I struggle to find the part of the code that actually does the reindentation. I would have expected it to be the "Reindenter" class, but it seems that by the time the lines are passed in there, they're already space-ified.
I'm aware this is outside the normal use-case of autopep8, but was wondering if one of the devs could give me some guidance on how to make it support the indentation with tabs rather than spaces.
Same problem here. I prefer tabs as indents.
Nothing on this still?
I too have to follow a coding style that uses tabs instead of spaces
still waiting on this
it works with an old version: autopep8 0.9.1
(at least when ignoring E501,E101,W191,E126,E128)
pip install autopep8==0.9.1
See also https://github.com/hhatto/autopep8/issues/242 https://github.com/hhatto/autopep8/issues/417