Hi,
Is there a way to keep the tabs when using C-c C-r p (elpy-autopep8-fix-code). My company standard is tabs over spaces but pep8 everything else.
I tried configuring autopep8 using the .config/pep8 also modifying auto_pep8.py but to not avail. Any hints?
Hello, and thanks for the report!
This seems like the same issue as #671 – apparently, Elpy's autopep8 feature does not read configuration options.
@ChillarAnand, any idea about this? Can we make the autopep8 code read the same configuration options as the command line tool?
If we pass --ignore=W191,E101,E111 to autopep8, it wont mess with tabs & spaces.
Yes we can make it
>>> autopep8.fix_code('print( 123 )\n',
... options={'ignore': ['E']})
'print( 123 )\n'
But I guess, elpy has to find setup.cfg & parse it.
Or we can run autopep8 via shell command which automatically picks up config?
A quick look at the code says that fix_code also takes a apply_config keyword argument that defaults to False – does it do the right thing if this is True?
:+1: yes, setting it to True reads config.
PR merged, thank you!
@mfcabrera, can you check with the current git master whether this solves your problem?
Lacking updates, I assume this was fixed indeed. Thanks again to everyone for the report and the quick fix!