-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
"Wrong hanging indentation" with tabs #1148
Comments
Is duplicated #638? |
I don't think it's identical, because
Another example of the same problem (of mine):
|
I'd say that the problem is caused by incorrect computation of indentation spaces in case of indentation by tabs.
Pylint wants us to add 14 more spaces ( When The correct computation should be as follows: But please, do not break the calculation of "continued indentation", which in case of tab indentation is done with spaces, and which works now:
|
Thank you for providing this input, I will take a look when I will get some free time. If you want to try your hand at a patch, please feel free to do so. |
+1 |
+1 |
1 similar comment
+1 |
A Tab is not equal to 8 spaces. So just counting tabs as 8 spaces is wrong. Use the whole 'tabs' and/or 'spaces' string for indentation checks instead of some imaginary number of whitespaces.
A Tab is not equal to 8 spaces. So just counting tabs as 8 spaces is wrong. Use the whole 'tabs' and/or 'spaces' string for indentation checks instead of some imaginary number of whitespaces.
+1 It would be great to get the patch above applied to mainline... |
+1. @x539, are you going to make a PR? @PCManticore any updates on this? |
A Tab is not equal to 8 spaces. So just counting tabs as 8 spaces is wrong. Use the whole 'tabs' and/or 'spaces' string for indentation checks instead of some imaginary number of whitespaces.
A Tab is not equal to 8 spaces. So just counting tabs as 8 spaces is wrong. Use the whole 'tabs' and/or 'spaces' string for indentation checks instead of some imaginary number of whitespaces.
|
Steps to reproduce
Note, the indentation is made via tabs, not spaces.
2.
pylint.exe --indent-string='\t' --indent-after-paren=1 --reports=no test.py
Current behavior
Adding more tabs or spaces at the beginning of the hanging line doesn't help.
Expected behavior
I would expect that pylint considers this hanging indentation correct. When the function is placed outside the class, the "Wrong hanging indentation" warning is not reported.
pylint --version output
The text was updated successfully, but these errors were encountered: