jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.89k stars 259 forks source link

Autopep8 not working after installation of elpy #881

Open ghost opened 8 years ago

ghost commented 8 years ago

I have a question:

i have installed elpy as described in the https://elpy.readthedocs.io/en/latest/introduction.html#installation, but for some reason it seems that autopep8 is not working properly for me. In the minibuffer down i see some instructions like: E231 missing whitespace after ','. But it doesn't get corrected automatically, i thought thats what autopep8 should do. Can anyone help?

jorgenschaefer commented 8 years ago

Does invoking autopep8 (or yapf) on the command line fix the problem? If not, I'm afraid that's a problem you have to take up with the autopep8 maintainer. :-(

ghost commented 8 years ago

You mean calling autopep8 or yapf from a terminal? Calling them from a terminal has no effects. :-(

jorgenschaefer commented 8 years ago

Yes, I mean that. I'm afraid Elpy simply uses those programs (or rather, their library interface). Could you file a feature request with your preferred one of them directly?

ghost commented 8 years ago

Ok, now it seems to be working! Obviously i needed to install py-autopep8 too https://github.com/paetzke/py-autopep8.el, to get it to work. Thank you anyway for your fast help as allways! :-)

jorgenschaefer commented 8 years ago

That's strange – Elpy comes with autopep8/yapf support. Did you use C-c C-r f?

ghost commented 8 years ago

No i didn't.

ghost commented 8 years ago

I am getting this message: E501 line too long (92 > 79 characters). Is this also autopep8? Is there a way to configure it to allow any line length?

jorgenschaefer commented 8 years ago

No. Elpy uses flake8 to do syntax checks. You can configure flake8 to change what errors it shows.

ghost commented 8 years ago

I can not find the flake8 file in ~/.config. There is a directory in /usr/local/lib/python2.7/dist-packages/flake8, but i don't think thats where i could configre it. Should i create a flake8 file myself in ~/.config directory?

jorgenschaefer commented 8 years ago

Should i create a flake8 file myself in ~/.config directory?

Yes.