|
2 | 2 | # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
|
3 | 3 | import platform
|
4 | 4 | import sys
|
5 |
| -from typing import Dict |
| 5 | +from typing import Dict, List, NamedTuple, Tuple |
6 | 6 |
|
7 | 7 | import astroid
|
8 | 8 | import platformdirs
|
@@ -72,3 +72,107 @@ class WarningScope:
|
72 | 72 | "class_const": "class constant",
|
73 | 73 | "inlinevar": "inline iteration",
|
74 | 74 | }
|
| 75 | + |
| 76 | + |
| 77 | +class DeletedMessage(NamedTuple): |
| 78 | + msgid: str |
| 79 | + symbol: str |
| 80 | + old_names: List[Tuple[str, str]] = [] |
| 81 | + |
| 82 | + |
| 83 | +DELETED_MSGID_PREFIXES = [ |
| 84 | + 16, # the PY3K+ checker, see https://github.com/PyCQA/pylint/pull/4942 |
| 85 | +] |
| 86 | + |
| 87 | +DELETED_MESSAGES = [ |
| 88 | + # Everything until the next comment is from the |
| 89 | + # PY3K+ checker, see https://github.com/PyCQA/pylint/pull/4942 |
| 90 | + DeletedMessage("W1601", "apply-builtin"), |
| 91 | + DeletedMessage("E1601", "print-statement"), |
| 92 | + DeletedMessage("E1602", "parameter-unpacking"), |
| 93 | + DeletedMessage( |
| 94 | + "E1603", "unpacking-in-except", [("W0712", "old-unpacking-in-except")] |
| 95 | + ), |
| 96 | + DeletedMessage("E1604", "old-raise-syntax", [("W0121", "old-old-raise-syntax")]), |
| 97 | + DeletedMessage("E1605", "backtick", [("W0333", "old-backtick")]), |
| 98 | + DeletedMessage("E1609", "import-star-module-level"), |
| 99 | + DeletedMessage("W1601", "apply-builtin"), |
| 100 | + DeletedMessage("W1602", "basestring-builtin"), |
| 101 | + DeletedMessage("W1603", "buffer-builtin"), |
| 102 | + DeletedMessage("W1604", "cmp-builtin"), |
| 103 | + DeletedMessage("W1605", "coerce-builtin"), |
| 104 | + DeletedMessage("W1606", "execfile-builtin"), |
| 105 | + DeletedMessage("W1607", "file-builtin"), |
| 106 | + DeletedMessage("W1608", "long-builtin"), |
| 107 | + DeletedMessage("W1609", "raw_input-builtin"), |
| 108 | + DeletedMessage("W1610", "reduce-builtin"), |
| 109 | + DeletedMessage("W1611", "standarderror-builtin"), |
| 110 | + DeletedMessage("W1612", "unicode-builtin"), |
| 111 | + DeletedMessage("W1613", "xrange-builtin"), |
| 112 | + DeletedMessage("W1614", "coerce-method"), |
| 113 | + DeletedMessage("W1615", "delslice-method"), |
| 114 | + DeletedMessage("W1616", "getslice-method"), |
| 115 | + DeletedMessage("W1617", "setslice-method"), |
| 116 | + DeletedMessage("W1618", "no-absolute-import"), |
| 117 | + DeletedMessage("W1619", "old-division"), |
| 118 | + DeletedMessage("W1620", "dict-iter-method"), |
| 119 | + DeletedMessage("W1621", "dict-view-method"), |
| 120 | + DeletedMessage("W1622", "next-method-called"), |
| 121 | + DeletedMessage("W1623", "metaclass-assignment"), |
| 122 | + DeletedMessage( |
| 123 | + "W1624", "indexing-exception", [("W0713", "old-indexing-exception")] |
| 124 | + ), |
| 125 | + DeletedMessage("W1625", "raising-string", [("W0701", "old-raising-string")]), |
| 126 | + DeletedMessage("W1626", "reload-builtin"), |
| 127 | + DeletedMessage("W1627", "oct-method"), |
| 128 | + DeletedMessage("W1628", "hex-method"), |
| 129 | + DeletedMessage("W1629", "nonzero-method"), |
| 130 | + DeletedMessage("W1630", "cmp-method"), |
| 131 | + DeletedMessage("W1632", "input-builtin"), |
| 132 | + DeletedMessage("W1633", "round-builtin"), |
| 133 | + DeletedMessage("W1634", "intern-builtin"), |
| 134 | + DeletedMessage("W1635", "unichr-builtin"), |
| 135 | + DeletedMessage( |
| 136 | + "W1636", "map-builtin-not-iterating", [("W1631", "implicit-map-evaluation")] |
| 137 | + ), |
| 138 | + DeletedMessage("W1637", "zip-builtin-not-iterating"), |
| 139 | + DeletedMessage("W1638", "range-builtin-not-iterating"), |
| 140 | + DeletedMessage("W1639", "filter-builtin-not-iterating"), |
| 141 | + DeletedMessage("W1640", "using-cmp-argument"), |
| 142 | + DeletedMessage("W1641", "eq-without-hash"), |
| 143 | + DeletedMessage("W1642", "div-method"), |
| 144 | + DeletedMessage("W1643", "idiv-method"), |
| 145 | + DeletedMessage("W1644", "rdiv-method"), |
| 146 | + DeletedMessage("W1645", "exception-message-attribute"), |
| 147 | + DeletedMessage("W1646", "invalid-str-codec"), |
| 148 | + DeletedMessage("W1647", "sys-max-int"), |
| 149 | + DeletedMessage("W1648", "bad-python3-import"), |
| 150 | + DeletedMessage("W1649", "deprecated-string-function"), |
| 151 | + DeletedMessage("W1650", "deprecated-str-translate-call"), |
| 152 | + DeletedMessage("W1651", "deprecated-itertools-function"), |
| 153 | + DeletedMessage("W1652", "deprecated-types-field"), |
| 154 | + DeletedMessage("W1653", "next-method-defined"), |
| 155 | + DeletedMessage("W1654", "dict-items-not-iterating"), |
| 156 | + DeletedMessage("W1655", "dict-keys-not-iterating"), |
| 157 | + DeletedMessage("W1656", "dict-values-not-iterating"), |
| 158 | + DeletedMessage("W1657", "deprecated-operator-function"), |
| 159 | + DeletedMessage("W1658", "deprecated-urllib-function"), |
| 160 | + DeletedMessage("W1659", "xreadlines-attribute"), |
| 161 | + DeletedMessage("W1660", "deprecated-sys-function"), |
| 162 | + DeletedMessage("W1661", "exception-escape"), |
| 163 | + DeletedMessage("W1662", "comprehension-escape"), |
| 164 | + # https://github.com/PyCQA/pylint/pull/3578 |
| 165 | + DeletedMessage("W0312", "mixed-indentation"), |
| 166 | + # https://github.com/PyCQA/pylint/pull/3577 |
| 167 | + DeletedMessage( |
| 168 | + "C0326", |
| 169 | + "bad-whitespace", |
| 170 | + [ |
| 171 | + ("C0323", "no-space-after-operator"), |
| 172 | + ("C0324", "no-space-after-comma"), |
| 173 | + ("C0322", "no-space-before-operator"), |
| 174 | + ], |
| 175 | + ), |
| 176 | + # https://github.com/PyCQA/pylint/pull/3571 |
| 177 | + DeletedMessage("C0330", "bad-continuation"), |
| 178 | +] |
0 commit comments