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

Automatically format code to PEP8 style using autopep8 #571

Closed
wants to merge 11 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@ChillarAnand
Contributor

ChillarAnand commented May 23, 2015

closes #566

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling d1bc394 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling d1bc394 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling d1bc394 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling d1bc394 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 111e60c on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 111e60c on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 111e60c on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 111e60c on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 111e60c on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 111e60c on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 13dcd60 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 13dcd60 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 13dcd60 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.26%) to 89.67% when pulling 13dcd60 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.13%) to 89.8% when pulling 30688b0 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.13%) to 89.8% when pulling 30688b0 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage decreased (-0.13%) to 89.8% when pulling 30688b0 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage decreased (-0.13%) to 89.8% when pulling 30688b0 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls May 23, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling f5197a8 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented May 23, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling f5197a8 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@jorgenschaefer jorgenschaefer added this to the v1.9 milestone May 29, 2015

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer May 29, 2015

Owner

First of all, thank you so much for this code! This is awesome.

I think it would be great if the autopep8 formatter would work on a region if one is selected, not unconditionally on the whole buffer.

Also, I think it would be nice to group the "code cleanup" stuff (elpy-importmagic-fixup and this) into a common key prefix to avoid cluttering too many key bindings, e.g. when we add the isort library. What do you think? (This could share the C-c C-r refactoring stuff …)

Lastly, out of curiosity, why did you remove -Qwarnall from the test runner?

Owner

jorgenschaefer commented May 29, 2015

First of all, thank you so much for this code! This is awesome.

I think it would be great if the autopep8 formatter would work on a region if one is selected, not unconditionally on the whole buffer.

Also, I think it would be nice to group the "code cleanup" stuff (elpy-importmagic-fixup and this) into a common key prefix to avoid cluttering too many key bindings, e.g. when we add the isort library. What do you think? (This could share the C-c C-r refactoring stuff …)

Lastly, out of curiosity, why did you remove -Qwarnall from the test runner?

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand May 30, 2015

Contributor

i saw this message

"Refactoring has been unstable and flakey, support will be dropped in the future."

and thought, may be you are going to depricate this.

Lastly, out of curiosity, why did you remove -Qwarnall from the test runner?

el

Contributor

ChillarAnand commented May 30, 2015

i saw this message

"Refactoring has been unstable and flakey, support will be dropped in the future."

and thought, may be you are going to depricate this.

Lastly, out of curiosity, why did you remove -Qwarnall from the test runner?

el

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 4, 2015

Owner

Yes, the current C-c C-r interface should go away at some point, and be replaced with something more sane.

Are you using Python 2 as python? That's a bit weird, but I guess the correct solution would be to use python2 there to make it explicit.

Owner

jorgenschaefer commented Jun 4, 2015

Yes, the current C-c C-r interface should go away at some point, and be replaced with something more sane.

Are you using Python 2 as python? That's a bit weird, but I guess the correct solution would be to use python2 there to make it explicit.

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jun 4, 2015

Contributor

I am moving auto pep8 to elpy refactor. Check out the code & let me know if i am doing it right.

Lastly, out of curiosity, why did you remove -Qwarnall from the test runner?

-Q option was removed in Python3?

$ python3 -Q
Unknown option: -Q
usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
(py3)
# anand at anand-X550EA in ~/projects/lisp/elpy on git:autopep8 x [23:21:41]
$ python2 -Q
Argument expected for the -Q option
Contributor

ChillarAnand commented Jun 4, 2015

I am moving auto pep8 to elpy refactor. Check out the code & let me know if i am doing it right.

Lastly, out of curiosity, why did you remove -Qwarnall from the test runner?

-Q option was removed in Python3?

$ python3 -Q
Unknown option: -Q
usage: python3 [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.
(py3)
# anand at anand-X550EA in ~/projects/lisp/elpy on git:autopep8 x [23:21:41]
$ python2 -Q
Argument expected for the -Q option
@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jun 4, 2015

Coverage Status

Coverage increased (+0.21%) to 90.14% when pulling 99b10e6 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented Jun 4, 2015

Coverage Status

Coverage increased (+0.21%) to 90.14% when pulling 99b10e6 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 4, 2015

Owner

I think there is a major misunderstanding here. I do not think adding autopep8 to the current refactor interface is worthwhile.

  • Adding tons of special-purpose commands to do refactoring is a bad idea, so I would prefer not to do that. (Your first pull request)
  • The current refactoring interface is terrible and needs to be replaced. No need to add anything to this.
  • What I said was that we probably should figure out a better interface in the mid term.
  • Until then, we probably can use special-purpose commands (as in your first proposal), but only under a single prefix key, not taking up a C-c C-X keys each.

Does that make it more clear what I mean? :-)

Owner

jorgenschaefer commented Jun 4, 2015

I think there is a major misunderstanding here. I do not think adding autopep8 to the current refactor interface is worthwhile.

  • Adding tons of special-purpose commands to do refactoring is a bad idea, so I would prefer not to do that. (Your first pull request)
  • The current refactoring interface is terrible and needs to be replaced. No need to add anything to this.
  • What I said was that we probably should figure out a better interface in the mid term.
  • Until then, we probably can use special-purpose commands (as in your first proposal), but only under a single prefix key, not taking up a C-c C-X keys each.

Does that make it more clear what I mean? :-)

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jun 5, 2015

Contributor

So, we can have a function elpy-code-cleanup which does importmagic-fixup, autopep8 & isort and bind that function to a single key(say C-c C-l)?

On Fri, Jun 5, 2015 at 2:07 AM, Jorgen Schäfer notifications@github.com
wrote:

I think there is a major misunderstanding here. I do not think adding
autopep8 to the current refactor interface is worthwhile.

  • Adding tons of special-purpose commands to do refactoring is a bad
    idea, so I would prefer not to do that. (Your first pull request)
  • The current refactoring interface is terrible and needs to be
    replaced. No need to add anything to this.
  • What I said was that we probably should figure out a better
    interface in the mid term.
  • Until then, we probably can use special-purpose commands (as in your
    first proposal), but only under a single prefix key, not taking up a C-c
    C-X keys each.

Does that make it more clear what I mean? :-)


Reply to this email directly or view it on GitHub
#571 (comment).

Contributor

ChillarAnand commented Jun 5, 2015

So, we can have a function elpy-code-cleanup which does importmagic-fixup, autopep8 & isort and bind that function to a single key(say C-c C-l)?

On Fri, Jun 5, 2015 at 2:07 AM, Jorgen Schäfer notifications@github.com
wrote:

I think there is a major misunderstanding here. I do not think adding
autopep8 to the current refactor interface is worthwhile.

  • Adding tons of special-purpose commands to do refactoring is a bad
    idea, so I would prefer not to do that. (Your first pull request)
  • The current refactoring interface is terrible and needs to be
    replaced. No need to add anything to this.
  • What I said was that we probably should figure out a better
    interface in the mid term.
  • Until then, we probably can use special-purpose commands (as in your
    first proposal), but only under a single prefix key, not taking up a C-c
    C-X keys each.

Does that make it more clear what I mean? :-)


Reply to this email directly or view it on GitHub
#571 (comment).

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jun 7, 2015

Contributor

I think it would be great if the autopep8 formatter would work on a region if one is selected, not unconditionally on the whole buffer.

That is a good idea. I have updated autopep8 to support that.

Also, I think it would be nice to group the "code cleanup" stuff (elpy-importmagic-fixup and this) into a common key prefix

Grouping these into a single key will be good if they are acting on whole buffer. However running impmagic fixup on region doesn't make sense as it is updating/sorting imports which are not in region.

Contributor

ChillarAnand commented Jun 7, 2015

I think it would be great if the autopep8 formatter would work on a region if one is selected, not unconditionally on the whole buffer.

That is a good idea. I have updated autopep8 to support that.

Also, I think it would be nice to group the "code cleanup" stuff (elpy-importmagic-fixup and this) into a common key prefix

Grouping these into a single key will be good if they are acting on whole buffer. However running impmagic fixup on region doesn't make sense as it is updating/sorting imports which are not in region.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jun 7, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling 24bbba9 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented Jun 7, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling 24bbba9 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jun 7, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling 24bbba9 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented Jun 7, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling 24bbba9 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@coveralls

This comment has been minimized.

Show comment
Hide comment
@coveralls

coveralls Jun 7, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling 24bbba9 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

coveralls commented Jun 7, 2015

Coverage Status

Coverage increased (+0.11%) to 90.04% when pulling 24bbba9 on ChillarAnand:autopep8 into 9cd3c29 on jorgenschaefer:master.

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 9, 2015

Owner

Grouping these into a single key will be good if they are acting on whole buffer. However running impmagic fixup on region doesn't make sense as it is updating/sorting imports which are not in region.

I think you misunderstood what I said – I was not talking about a single key, but about a prefix key. E.g. have C-c C-FOO i call importmagic stuff, and C-c C-FOO f use autopep8. My biggest problem here is that I have no idea what key to use for C-FOO. Ideally, we'd eventually use C-c C-r for a generalized refactoring interface that does all of this in a sane way, but I do not see that any time soon. So we'd need an intermediate solution.

Do you have ideas?

Owner

jorgenschaefer commented Jun 9, 2015

Grouping these into a single key will be good if they are acting on whole buffer. However running impmagic fixup on region doesn't make sense as it is updating/sorting imports which are not in region.

I think you misunderstood what I said – I was not talking about a single key, but about a prefix key. E.g. have C-c C-FOO i call importmagic stuff, and C-c C-FOO f use autopep8. My biggest problem here is that I have no idea what key to use for C-FOO. Ideally, we'd eventually use C-c C-r for a generalized refactoring interface that does all of this in a sane way, but I do not see that any time soon. So we'd need an intermediate solution.

Do you have ideas?

@whirm

This comment has been minimized.

Show comment
Hide comment
@whirm

whirm Jun 9, 2015

Contributor

what about using hydra?

Contributor

whirm commented Jun 9, 2015

what about using hydra?

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 9, 2015

Owner

At least hydra-like would be an option, but that still needs an initial key sequence :-)

Owner

jorgenschaefer commented Jun 9, 2015

At least hydra-like would be an option, but that still needs an initial key sequence :-)

@whirm

This comment has been minimized.

Show comment
Hide comment
@whirm

whirm Jun 9, 2015

Contributor

I mean replacing the current refactoring menu with hydra, and keep using C-c C-r: if you have a region active, you can show different options than if you don't. And you tie all the refactoring stuff there, even the existing functionality.

That could be done in a single step with not much effort, right? Or is there something I'm not getting?

Contributor

whirm commented Jun 9, 2015

I mean replacing the current refactoring menu with hydra, and keep using C-c C-r: if you have a region active, you can show different options than if you don't. And you tie all the refactoring stuff there, even the existing functionality.

That could be done in a single step with not much effort, right? Or is there something I'm not getting?

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 9, 2015

Owner

No, that's quite fine. Except the current refactoring menu needs to be reworked.

(And I'm reluctant to add a dependency on hydra just for C-c C-r, but a hydra-like interface is pretty much what I had in mind for when I have a lot of time to work on this :-D)

Owner

jorgenschaefer commented Jun 9, 2015

No, that's quite fine. Except the current refactoring menu needs to be reworked.

(And I'm reluctant to add a dependency on hydra just for C-c C-r, but a hydra-like interface is pretty much what I had in mind for when I have a lot of time to work on this :-D)

@whirm

This comment has been minimized.

Show comment
Hide comment
@whirm

whirm Jun 10, 2015

Contributor

@jorgenschaefer what about magit-popup? Who doesn't have magit installed anyway? :D

Contributor

whirm commented Jun 10, 2015

@jorgenschaefer what about magit-popup? Who doesn't have magit installed anyway? :D

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 10, 2015

Owner

Who doesn't have magit installed anyway? :D

Me. :-)

Owner

jorgenschaefer commented Jun 10, 2015

Who doesn't have magit installed anyway? :D

Me. :-)

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jun 10, 2015

Contributor

@jorgenschaefer since elpy is CLeaning the code, C-c C-l seems to be okay as prefix.

makey looks like light weight solution for key binding interface?

personally, i use guide-key. when i press C-c C-l
aut

Contributor

ChillarAnand commented Jun 10, 2015

@jorgenschaefer since elpy is CLeaning the code, C-c C-l seems to be okay as prefix.

makey looks like light weight solution for key binding interface?

personally, i use guide-key. when i press C-c C-l
aut

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jun 11, 2015

Owner

I do not think we need an external package for this feature until we flesh it out fully with more refactoring options (and even then we can easily do our own, this is a trivial use case).

C-c C-l is already taken. Although I do not know how well used it is, I guess it would be a bad idea to use a different key binding as an intermediate if we already know we're going to do something else.

So I think what I'd like here would be re-using C-c C-r, but keeping the old interface in a sub-key for that. Something like:

C-c C-r i / C-c C-r C-i for importmagic
C-c C-r TAB / C-c C-r C-TAB for autopep8 – alternatively, C-c C-r 8 or C-c C-r p for _p_ep8? Preferences?
C-c C-r r / C-c C-r C-r for the current refactoring interface

Bonus points: Make C-c C-r display the selection options in the minibuffer.

Opinions?

Owner

jorgenschaefer commented Jun 11, 2015

I do not think we need an external package for this feature until we flesh it out fully with more refactoring options (and even then we can easily do our own, this is a trivial use case).

C-c C-l is already taken. Although I do not know how well used it is, I guess it would be a bad idea to use a different key binding as an intermediate if we already know we're going to do something else.

So I think what I'd like here would be re-using C-c C-r, but keeping the old interface in a sub-key for that. Something like:

C-c C-r i / C-c C-r C-i for importmagic
C-c C-r TAB / C-c C-r C-TAB for autopep8 – alternatively, C-c C-r 8 or C-c C-r p for _p_ep8? Preferences?
C-c C-r r / C-c C-r C-r for the current refactoring interface

Bonus points: Make C-c C-r display the selection options in the minibuffer.

Opinions?

@whirm

This comment has been minimized.

Show comment
Hide comment
@whirm

whirm Jun 11, 2015

Contributor

Looks fine to me.

Contributor

whirm commented Jun 11, 2015

Looks fine to me.

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jun 11, 2015

Contributor
C-c C-r i - importmagic
C-c C-r r - refactoring
C-c C-r p - pep8ify

looks good to me :)

Contributor

ChillarAnand commented Jun 11, 2015

C-c C-r i - importmagic
C-c C-r r - refactoring
C-c C-r p - pep8ify

looks good to me :)

ChillarAnand added some commits Jul 30, 2015

Show refactoring select options in minibuffer
Group all refactoring options to common key prefix `C-c C-r`.
@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jul 30, 2015

Contributor

Is this ok for showing refactoring options?

Contributor

ChillarAnand commented Jul 30, 2015

Is this ok for showing refactoring options?

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jul 30, 2015

Owner

I like that!

Owner

jorgenschaefer commented Jul 30, 2015

I like that!

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Jul 30, 2015

Owner

As a note, I haven't forgotten your contributions, I'm just quite busy as of late. I will have more time to work on Elpy mid-August I hope. Sorry about that!

Owner

jorgenschaefer commented Jul 30, 2015

As a note, I haven't forgotten your contributions, I'm just quite busy as of late. I will have more time to work on Elpy mid-August I hope. Sorry about that!

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Jul 31, 2015

Contributor

No issues :-)
Yesterday I was reading about interactive c and thought may be that is sufficient for refactoring options.

Contributor

ChillarAnand commented Jul 31, 2015

No issues :-)
Yesterday I was reading about interactive c and thought may be that is sufficient for refactoring options.

@jorgenschaefer

This comment has been minimized.

Show comment
Hide comment
@jorgenschaefer

jorgenschaefer Aug 22, 2015

Owner

Ok, looking over the code, I definitely like this. Could you rebase the PR onto of the master branch, and squash it to a single commit? Thank you!

Owner

jorgenschaefer commented Aug 22, 2015

Ok, looking over the code, I definitely like this. Could you rebase the PR onto of the master branch, and squash it to a single commit? Thank you!

@ChillarAnand ChillarAnand deleted the ChillarAnand:autopep8 branch Aug 22, 2015

@abdulhaq-e

This comment has been minimized.

Show comment
Hide comment
@abdulhaq-e

abdulhaq-e Sep 4, 2015

Is there a way to turn this off without uninstalling autopep8?

abdulhaq-e commented Sep 4, 2015

Is there a way to turn this off without uninstalling autopep8?

@ChillarAnand

This comment has been minimized.

Show comment
Hide comment
@ChillarAnand

ChillarAnand Sep 4, 2015

Contributor

To format code as per PEP8 conventions, you need to run C-c C-r p which will do formatting.

Elpy will not automatically format code as you type.

Contributor

ChillarAnand commented Sep 4, 2015

To format code as per PEP8 conventions, you need to run C-c C-r p which will do formatting.

Elpy will not automatically format code as you type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment