oderwat / vscode-indent-rainbow

Extension which shows indentation with a faint rainbow colored background to make them more readable
MIT License
409 stars 55 forks source link

Python : Indentation is proper but indent rainbow is showing it as error #70

Closed KumarswamyS closed 4 years ago

KumarswamyS commented 4 years ago

I have a print statement in python which is of two lines, indent rainbow is improperly showing the second line of the print statement as indentation error.

print("\033[92m"+"{0:.2f}".format(monthlyRet[0]*100),
      "{0:.2f}".format(bimonthlyRet[0]*100)+"\033[00m")

Second line of print statement is improperly indentented accoring to indent rainbow

oderwat commented 4 years ago

It is... according to the rules. Just switch it off and use a lint tool if you want to have language agnostic indentation error tests.

Exploder98 commented 4 years ago

@oderwat What rules are you referring to? According to PEP8 (Python style guide), continuation indents should be aligned with the opening delimiter. I can of course set the error color to be completely transparent, but that kind of destroys its idea.

oderwat commented 4 years ago

The rules from the settings?

An error is by definition:

if the number of spaces is not a multiple of "tabSize".

This is no linter and could care less about Python style guides!

I would suggest, that you use a linter for checking your Python code style and disable errors in indent-rainbow as they are obviously not what you expect them to be.