78
78
import astroid
79
79
from astroid import nodes
80
80
81
- from pylint import checkers , interfaces
81
+ from pylint import checkers , constants , interfaces
82
82
from pylint import utils as lint_utils
83
83
from pylint .checkers import utils
84
84
from pylint .checkers .utils import (
@@ -1672,20 +1672,6 @@ def visit_for(self, node: nodes.For) -> None:
1672
1672
"inlinevar" ,
1673
1673
}
1674
1674
1675
- HUMAN_READABLE_TYPES = {
1676
- "module" : "module" ,
1677
- "const" : "constant" ,
1678
- "class" : "class" ,
1679
- "function" : "function" ,
1680
- "method" : "method" ,
1681
- "attr" : "attribute" ,
1682
- "argument" : "argument" ,
1683
- "variable" : "variable" ,
1684
- "class_attribute" : "class attribute" ,
1685
- "class_const" : "class constant" ,
1686
- "inlinevar" : "inline iteration" ,
1687
- }
1688
-
1689
1675
DEFAULT_NAMING_STYLES = {
1690
1676
"module" : "snake_case" ,
1691
1677
"const" : "UPPER_CASE" ,
@@ -1704,7 +1690,7 @@ def visit_for(self, node: nodes.For) -> None:
1704
1690
def _create_naming_options ():
1705
1691
name_options = []
1706
1692
for name_type in sorted (KNOWN_NAME_TYPES ):
1707
- human_readable_name = HUMAN_READABLE_TYPES [name_type ]
1693
+ human_readable_name = constants . HUMAN_READABLE_TYPES [name_type ]
1708
1694
default_style = DEFAULT_NAMING_STYLES [name_type ]
1709
1695
name_type = name_type .replace ("_" , "-" )
1710
1696
name_options .append (
@@ -2025,7 +2011,7 @@ def _raise_name_warning(
2025
2011
confidence ,
2026
2012
warning : str = "invalid-name" ,
2027
2013
) -> None :
2028
- type_label = HUMAN_READABLE_TYPES [node_type ]
2014
+ type_label = constants . HUMAN_READABLE_TYPES [node_type ]
2029
2015
hint = self ._name_hints [node_type ]
2030
2016
if prevalent_group :
2031
2017
# This happens in the multi naming match case. The expected
0 commit comments