Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is default PyCharm's code formatter?

I don't use Pycharm as my Python environment, neither do I have it on my PC.
However, we often have dicusses with coworkers about codestyle and while I prefer black, they use internal PyCharm formatter.

I didn't found any mention at JetBrains website, what the thing it is, any suggestions?

like image 640
Alveona Avatar asked Aug 11 '26 13:08

Alveona


1 Answers

According to the docs,

PyCharm adheres to PEP8 rules and requirements for arranging and formatting Python code.

From how I understand it, there is still some flexibility under pep8.

For example, the default formatter on Pycharm allows for use of single or double quotes on strings and does not require that to be consistent in the code.

Whereas, Black is very specific to expect double quotes on strings across all files unless configured otherwise.

I presume Pycharm's default IDE python formatter will make the minimum changes necessary to fulfill pep8 and the exact behavior is determined by the individual's coding preferences.

like image 77
Rob Avatar answered Aug 14 '26 10:08

Rob



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!