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

[BUG] IndentChecker for pylint uses reserved message symbol prefixes #482

Closed
DanielNoord opened this issue Jan 26, 2022 · 4 comments
Closed

Comments

@DanielNoord
Copy link

Describe the bug
As discussed in:
#481 (comment)

Currently, the IndentChecker for pylint defines two new messages:
https://github.com/PyCQA/prospector/blob/c31bb80d61d49d37a1fe67635aae22f5896111ed/prospector/tools/pylint/indent_checker.py#L15-L24

However, these messages are prefixed with 03. According to the official pylint "documentation" that prefix is actually reserved for pylint's own messages. See:
https://github.com/PyCQA/pylint/blob/0fb6a120c6f0fbc94e305542fe29e790274be096/pylint/checkers/__init__.py#L52

The messages should therefore probably be renamed to use a 51+ prefix.
The old-name system could be used for this, although that might create issues when pylint starts defining W0314. I'll leave the actual resolution of this "bug" up to the maintainers.

@DanielNoord DanielNoord changed the title [BUG] [BUG] IndentChecker for pylint uses reserved message symbol prefixes Jan 26, 2022
@carlio
Copy link
Member

carlio commented Jan 26, 2022

Thanks @DanielNoord - I'll look into this. I wonder if this checker is no longer necessary, as I suspect pylint already checks for mixed spacing/tabs now. This checker was written about 8 years ago!

It's odd that I used plugin-specific ranges for pylint-django but forgot that and used the 03 prefix for format messages in prospector 🤷

Either I'll remove this checker or rename the message IDs.

@DanielNoord
Copy link
Author

Oh well 😄

If you're going through the effort of checking whether pylint already does this, it might make sense to see if this can be ported? If it has been working without issues for 8 years it might be a good addition to pylint itself? It could be added to the CodeStyleChecker?

@Pierre-Sassoulas
Copy link
Collaborator

Mixed indentation is checked by python itself, we removed it from pylint in pylint-dev/pylint#3578

@carlio
Copy link
Member

carlio commented Feb 26, 2022

Closing as I have removed this checker from prospector now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants