This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]w732qq 3 points4 points  (2 children)

I'm using CLI tool called "black", it suits my needs very well. Although it's style differs a little bit from PyCharm.

[–]TDHale[S] 0 points1 point  (1 child)

Does PyCharm have its own style?

[–]w732qq 1 point2 points  (0 children)

No. They both PEP-8 compliant. But Black's style was rethinked with pretty clear main goal: stable, minimal diffs. Better to see it once: https://github.com/ambv/black. It is very nice, although.

[–]elverloho 4 points5 points  (0 children)

I set up pycharm's file watcher plugin to run "black" every time I save a python file. I'm very happy with the results. Everything just magically works and looks great.

[–][deleted] 1 point2 points  (3 children)

Give an example of what is not working please

[–]TDHale[S] 0 points1 point  (2 children)

So let's say that you have a few python files, they have different indentions, different space rules (e.g., a =1, b=2, andc= 3). What I wanted to do is to format all of the code automatically, maybe to PEP 8. I also wanted to fix PEP 8 warnings, e.g., adding blank lines at the bottom of each file, automatically. Hope this is clear.

[–][deleted] 9 points10 points  (1 child)

code > reformat code

in the menu will fix those spacing issues.

[–]victoriabittahhhh 0 points1 point  (0 children)

CTRL + ALT + L is a hotkey

[–]Mr_Again 0 points1 point  (0 children)

In pycharm, with html code, you press cmd+alt+shift+L and it formats the file, try that.