-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test to check that no old msgid or symbol are used (#5839)
* Add deleted msgid and symbol from the Python 3K+ checker and other deleted checks. See #4942 Closes #5729 Co-authored-by: Daniël van Noord <[email protected]>
- Loading branch information
1 parent
15040ee
commit 5bdd503
Showing
7 changed files
with
146 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 | ||
) |