Skip to content
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

E128: Indentation checks could contain exact information #928

Open
Dreamsorcerer opened this issue Apr 28, 2020 · 4 comments
Open

E128: Indentation checks could contain exact information #928

Dreamsorcerer opened this issue Apr 28, 2020 · 4 comments

Comments

@Dreamsorcerer
Copy link

It could be more helpful for a developer new to a codebase, that perhaps doesn't know the indentation still in use, to be told exactly where the indentation should go.

This could just be added to the end of the error like (expected 20, got 8).

@sigmavirus24
Copy link
Member

Your description isn't comprehensible to me. Can you add an example of what you're running against, what you're getting and how what you're proposing helps?

@asottile
Copy link
Member

I believe what the original post is asking for is something like this (really ugly example, but):

if True:
    if (a() and
    b()):
        print('hi')
$ ~/opt/venv/bin/pycodestyle t.py
t.py:3:5: E128 continuation line under-indented for visual indent

but OP would like to see

$ ~/opt/venv/bin/pycodestyle t.py
t.py:3:5: E128 continuation line under-indented for visual indent (indented 4 spaces, expected 8 or 12 spaces)

but I guess that demonstrates another problem, there's multiple things that could be suggested for each code. satisfying one of them may also break another code (for example, 8 spaces is ok for E128 but then triggers E129)

@Dreamsorcerer
Copy link
Author

Indeed. I got the idea from flake8-tabs, which I noticed adds this information (but, unless you want to use tabs, it does nothing else of interest).

@sigmavirus24
Copy link
Member

I guess that demonstrates another problem, there's multiple things that could be suggested for each code

Yes, well I think baby steps towards the right solution is a fair thing to do. Adding "indented 4 spaces but expected 8 or 12 spaces" could be helpful to even someone just new to this tool, let alone a random codebase. As we aggregate the most common pain-points of these hints we can make the hints slightly better to reduce annoyance.

@asottile asottile changed the title Indentation checks (e.g. E128) could contain exact information E128: Indentation checks could contain exact information Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants