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

WPS453 has wrong line (row) number #1621

Closed
orsinium opened this issue Sep 25, 2020 · 2 comments
Closed

WPS453 has wrong line (row) number #1621

orsinium opened this issue Sep 25, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@orsinium
Copy link
Collaborator

Bug report

What's wrong

WPS453 ("Found executable mismatch: shebang is present but the file is not executable") points to 0:1.

Can be reproduced running against the following file:
https://github.com/life4/flakehell/blob/master/example.py

Or online on https://flakehell.orsinium.dev/

How is that should be

  1. The row number cannot be less than 1.
  2. The row number should point to the incorrect shebang.

System information

Not relevant

@orsinium orsinium added the bug Something isn't working label Sep 25, 2020
@sobolevn
Copy link
Member

Yes, this is correct. Because I don't want people to use noqa for this rule.

@orsinium
Copy link
Collaborator Author

Yes, this is correct.

I think this can lead to unforeseen bugs.

  1. It can be ignored by some IDEs since it points to no line.
  2. It is documented as starting counting from 1: https://github.com/PyCQA/flake8/blob/master/src/flake8/style_guide.py#L408-L410
  3. It breaks indentation in the built-in flake8 formatter: https://github.com/PyCQA/flake8/blob/master/src/flake8/formatting/base.py#L176-L179

I don't want people to use noqa for this rule.

  1. You already have a check for noqa count over a file.
  2. Any violation always can be ignored in the config, via CLI, or as module-level noqa.
  3. Linter should guide, not force. And even when this is a way to enforce rules in a team, every noqa should be checked on the review. This point is opinionated but I'm not sure if we should intentionally take from users the way to ignore violations when they find it sufficient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants