I've been using PyCharm IDE a lot recently when working with the TensorFlow Python repository. TensorFlow follows the PEP8 Python style guide, except for using 2 spaces for indents.
By default in PyCharm IDE I have the PEP8 inspection enabled to enable my codes follows PEP8 style convention. An undesirable side-effect is now I have warnings all over the place within PyCharm editor, flagging all indents (which are 2 spaces instead of 4 spaces).
If I disable PEP8 inspection, all warnings go away at the trade-off of no more PEP8 inspection (which is desirable).
Is there a way to enable full PEP8 inspection within PyCharm editor, but ignoring the 2-space indents?
Here is an example of the PEP8 warning (about indent spaces should be 4 not 2):
Here is a snapshot of PyCharm preferences page, under PEP8 inspection section (looks like it's either on/off - unless I'm missing something):
Two good options (for different purposes):
Put the cursor on the error being highlighted (e.g raise
in your image) press Alt + Enter
and choose Ignore errors like this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With