-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add a test to check that no old msgid or symbol are used #5839
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e0234d9
Add a test to check that no old msgid or symbol are used
Pierre-Sassoulas 7bdcce4
Add deleted msgid and symbol from the Python 3K+ checker
Pierre-Sassoulas e0ffbe7
Add other deleted checkers to the check
Pierre-Sassoulas 1fe4b8a
Fix mismatch with old py3K checker and upgrade id script
Pierre-Sassoulas 06b2b19
Take review into account
Pierre-Sassoulas e94e51c
Update tests/message/test_no_removed_msgid_or_symbol_used.py
Pierre-Sassoulas d2cf57e
Take review into account
Pierre-Sassoulas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html | ||
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE | ||
|
||
from pylint.constants import DELETED_MESSAGES | ||
from pylint.lint import PyLinter | ||
|
||
|
||
def test_no_removed_msgid_or_symbol_used(linter: PyLinter) -> None: | ||
"""Tests that we're not using deleted msgid or symbol. | ||
|
||
This could cause occasional bugs, but more importantly confusion and inconsistencies | ||
when searching for old msgids online. See https://github.com/PyCQA/pylint/issues/5729 | ||
""" | ||
for msgid, symbol, old_names in DELETED_MESSAGES: | ||
linter.msgs_store.message_id_store.register_message_definition( | ||
msgid, symbol, old_names | ||
) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this is difficult. This is an important change, but this is technically breaking... Should it be in
3.0
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to fix this "fast" as we don't want to have a lot of content on the web with W1601 and W1602 meaning the new message. The breaking change is reasonable imo as it only breaks disable using msgid and not the symbol directly. (Also, the symbol should be preferred we even have a check for that so it's probably not affecting a lot of users ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah and I guess you could consider the previous change breaking. As in, we're reverting a previously unnoticed breaking change here.
Let's just go ahead with it.