diff options
-rw-r--r-- | pylint/checkers/exceptions.py | 2 | ||||
-rw-r--r-- | pylint/checkers/logging.py | 8 | ||||
-rw-r--r-- | pylint/checkers/strings.py | 9 | ||||
-rw-r--r-- | pylint/checkers/utils.py | 10 | ||||
-rw-r--r-- | pylint/checkers/variables.py | 10 | ||||
-rw-r--r-- | tox.ini | 4 |
6 files changed, 26 insertions, 17 deletions
diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index 360e1d148..c00e6e37a 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -380,7 +380,7 @@ class ExceptionsChecker(checkers.BaseChecker): def _check_try_except_raise(self, node): def gather_exceptions_from_handler( - handler + handler, ) -> typing.Optional[typing.List[NodeNG]]: exceptions = [] # type: typing.List[NodeNG] if handler.type: diff --git a/pylint/checkers/logging.py b/pylint/checkers/logging.py index 5ad0e765f..63a95b8b4 100644 --- a/pylint/checkers/logging.py +++ b/pylint/checkers/logging.py @@ -306,9 +306,11 @@ class LoggingChecker(checkers.BaseChecker): # special keywords - out of scope. return elif self._format_style == "new": - keyword_arguments, implicit_pos_args, explicit_pos_args = utils.parse_format_method_string( - format_string - ) + ( + keyword_arguments, + implicit_pos_args, + explicit_pos_args, + ) = utils.parse_format_method_string(format_string) keyword_args_cnt = len( set(k for k, l in keyword_arguments if not isinstance(k, int)) diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index abdf2e8ef..c5594b61c 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -238,9 +238,12 @@ class StringFormatChecker(BaseChecker): return format_string = left.value try: - required_keys, required_num_args, required_key_types, required_arg_types = utils.parse_format_string( - format_string - ) + ( + required_keys, + required_num_args, + required_key_types, + required_arg_types, + ) = utils.parse_format_string(format_string) except utils.UnsupportedFormatCharacter as exc: formatted = format_string[exc.index] self.add_message( diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py index 94d5d49ff..4bda9ff78 100644 --- a/pylint/checkers/utils.py +++ b/pylint/checkers/utils.py @@ -221,7 +221,7 @@ def is_inside_lambda(node: astroid.node_classes.NodeNG) -> bool: def get_all_elements( - node: astroid.node_classes.NodeNG + node: astroid.node_classes.NodeNG, ) -> Iterable[astroid.node_classes.NodeNG]: """Recursively returns all atoms in nested lists and tuples.""" if isinstance(node, (astroid.Tuple, astroid.List)): @@ -232,7 +232,7 @@ def get_all_elements( def clobber_in_except( - node: astroid.node_classes.NodeNG + node: astroid.node_classes.NodeNG, ) -> Tuple[bool, Optional[Tuple[str, str]]]: """Checks if an assignment node in an except handler clobbers an existing variable. @@ -449,7 +449,7 @@ class UnsupportedFormatCharacter(Exception): def parse_format_string( - format_string: str + format_string: str, ) -> Tuple[Set[str], int, Dict[str, str], List[str]]: """Parses a format string, returning a tuple of (keys, num_args), where keys is the set of mapping keys in the format string, and num_args is the number @@ -564,7 +564,7 @@ def collect_string_fields(format_string) -> Iterable[Optional[str]]: def parse_format_method_string( - format_string: str + format_string: str, ) -> Tuple[List[Tuple[str, List[Tuple[bool, str]]]], int, int]: """ Parses a PEP 3101 format string, returning a tuple of @@ -835,7 +835,7 @@ def unimplemented_abstract_methods( def find_try_except_wrapper_node( - node: astroid.node_classes.NodeNG + node: astroid.node_classes.NodeNG, ) -> Union[astroid.ExceptHandler, astroid.TryExcept]: """Return the ExceptHandler or the TryExcept node in which the node is.""" current = node diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index dc1f99be4..6a2887053 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -660,8 +660,8 @@ class VariablesChecker(BaseChecker): def __init__(self, linter=None): BaseChecker.__init__(self, linter) self._to_consume = ( - None - ) # list of tuples: (to_consume:dict, consumed:dict, scope_type:str) + None # list of tuples: (to_consume:dict, consumed:dict, scope_type:str) + ) self._checking_mod_attr = None self._loop_variables = [] self._type_annotation_names = [] @@ -1030,7 +1030,11 @@ class VariablesChecker(BaseChecker): # -- quit break - maybee0601, annotation_return, use_outer_definition = self._is_variable_violation( + ( + maybee0601, + annotation_return, + use_outer_definition, + ) = self._is_variable_violation( node, name, defnode, @@ -14,8 +14,8 @@ commands = pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extens [testenv:formatting] basepython = python3 deps = - black==19.3b0 - isort==4.3.15 + black==19.10b0 + isort==4.3.21 commands = black --check pylint isort -rc pylint/ --check-only |