diff options
-rw-r--r-- | README.rst | 2 | ||||
-rwxr-xr-x | doc/exts/pylint_extensions.py | 2 | ||||
-rw-r--r-- | doc/whatsnew/2.6.rst | 2 | ||||
-rw-r--r-- | pylint/checkers/base.py | 2 | ||||
-rw-r--r-- | pylint/checkers/classes.py | 8 | ||||
-rw-r--r-- | pylint/checkers/format.py | 4 | ||||
-rw-r--r-- | pylint/checkers/imports.py | 4 | ||||
-rw-r--r-- | pylint/checkers/refactoring/refactoring_checker.py | 14 | ||||
-rw-r--r-- | pylint/checkers/strings.py | 2 | ||||
-rw-r--r-- | pylint/checkers/variables.py | 2 | ||||
-rw-r--r-- | tests/checkers/unittest_python3.py | 2 | ||||
-rw-r--r-- | tests/functional/l/line_too_long.py | 2 | ||||
-rw-r--r-- | tests/functional/s/stop_iteration_inside_generator.py | 14 | ||||
-rw-r--r-- | tests/functional/u/ungrouped_imports.py | 2 | ||||
-rw-r--r-- | tests/functional/u/using_constant_test.py | 2 | ||||
-rw-r--r-- | tox.ini | 2 |
16 files changed, 33 insertions, 33 deletions
diff --git a/README.rst b/README.rst index 6522d7b07..5fb8ced35 100644 --- a/README.rst +++ b/README.rst @@ -126,7 +126,7 @@ We use pytest_ for testing ``pylint``, which you can use without using ``tox`` f If you want to run tests on a specific portion of the code with pytest_, (pytest-cov_) and your local python version:: - # ( pip install pytest-cov ) + # ( pip install pytest-cov ) # Everything: python3 -m pytest tests/ # Everything in tests/message with coverage for the relevant code: diff --git a/doc/exts/pylint_extensions.py b/doc/exts/pylint_extensions.py index 107079370..c78eb1f3c 100755 --- a/doc/exts/pylint_extensions.py +++ b/doc/exts/pylint_extensions.py @@ -18,7 +18,7 @@ from pylint.utils import get_rst_title # Skip documenting these modules since: # 1) They are deprecated, why document them moving forward? # 2) We can't load the deprecated module and the newly renamed module at the -# same time without getting naming conflicts +# same time without getting naming conflicts DEPRECATED_MODULES = ["check_docs"] # ==> docparams diff --git a/doc/whatsnew/2.6.rst b/doc/whatsnew/2.6.rst index 406c5ba52..812638cee 100644 --- a/doc/whatsnew/2.6.rst +++ b/doc/whatsnew/2.6.rst @@ -31,7 +31,7 @@ Other Changes * `bad-continuation` and `bad-whitespace` have been removed. `black` or another formatter can help you with this better than Pylint -* The `no-space-check` option has been removed, it's no longer possible to consider empty line like a `trailing-whitespace` by using clever options. +* The `no-space-check` option has been removed, it's no longer possible to consider empty line like a `trailing-whitespace` by using clever options. * `mixed-indentation` has been removed, it is no longer useful since TabError is included directly in python3 diff --git a/pylint/checkers/base.py b/pylint/checkers/base.py index 17400bc11..e3c40118d 100644 --- a/pylint/checkers/base.py +++ b/pylint/checkers/base.py @@ -1132,7 +1132,7 @@ class BasicChecker(_BasicChecker): self.add_message("using-constant-test", node=node) elif isinstance(inferred, const_nodes): # If the constant node is a FunctionDef or Lambda then - # it may be a illicit function call due to missing parentheses + # it may be a illicit function call due to missing parentheses call_inferred = None try: if isinstance(inferred, astroid.FunctionDef): diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index 686bf278f..890d9f750 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -253,9 +253,9 @@ def _has_different_parameters_default_value(original, overridden): ) original_type = _get_node_type(original_default, handled_types) if original_type: - # We handle only astroid types that are inside the dict astroid_type_compared_attr + # We handle only astroid types that are inside the dict astroid_type_compared_attr if not isinstance(overridden_default, original_type): - # Two args with same name but different types + # Two args with same name but different types return True if not _check_arg_equality( original_default, @@ -1061,7 +1061,7 @@ a metaclass class method.", ): return - # Check values of default args + # Check values of default args klass = function.parent.frame() meth_node = None for overridden in klass.local_attr_ancestors(function.name): @@ -1418,7 +1418,7 @@ a metaclass class method.", if _is_attribute_property(name, klass): return - # A licit use of protected member is inside a special method + # A licit use of protected member is inside a special method if not attrname.startswith( "__" ) and self._is_called_inside_special_method(node): diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index fdbc8f4bc..f5aeccc19 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -385,7 +385,7 @@ class FormatChecker(BaseTokenChecker): # Since the walrus operator doesn't exist below python3.8, the tokenizer # generates independent tokens if ( - token.string == ":=" # <-- python3.8+ path + token.string == ":=" # <-- python3.8+ path or token.string + tokens[i + 1].string == ":=" ): contains_walrus_operator = True @@ -725,7 +725,7 @@ class FormatChecker(BaseTokenChecker): - no trailing whitespace - less than a maximum number of characters """ - # By default, check the line length + # By default, check the line length check_l_length = True # Line length check may be deactivated through `pylint: disable` comment diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py index ccd884063..37b814e30 100644 --- a/pylint/checkers/imports.py +++ b/pylint/checkers/imports.py @@ -548,8 +548,8 @@ class ImportsChecker(BaseChecker): std_imports, ext_imports, loc_imports = self._check_imports_order(node) # Check that imports are grouped by package within a given category - met_import = set() # set for 'import x' style - met_from = set() # set for 'from x import y' style + met_import = set() # set for 'import x' style + met_from = set() # set for 'from x import y' style current_package = None for import_node, import_name in std_imports + ext_imports + loc_imports: if not self.linter.is_message_enabled( diff --git a/pylint/checkers/refactoring/refactoring_checker.py b/pylint/checkers/refactoring/refactoring_checker.py index a296b7d40..ec52b4b2f 100644 --- a/pylint/checkers/refactoring/refactoring_checker.py +++ b/pylint/checkers/refactoring/refactoring_checker.py @@ -639,7 +639,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): self._emit_nested_blocks_message_if_needed(self._nested_blocks) # new scope = reinitialize the stack of nested blocks self._nested_blocks = [] - # check consistent return statements + # check consistent return statements self._check_consistent_returns(node) # check for single return or return None at the end self._check_return_at_the_end(node) @@ -1257,7 +1257,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): ) if not node.orelse: # If there is not orelse part then the if statement is returning if : - # - there is at least one return statement in its siblings; + # - there is at least one return statement in its siblings; # - the if body is itself returning. if not self._has_return_in_siblings(node): return False @@ -1287,8 +1287,8 @@ class RefactoringChecker(checkers.BaseTokenChecker): return True if not utils.is_node_inside_try_except(node): # If the raise statement is not inside a try/except statement - # then the exception is raised and cannot be caught. No need - # to infer it. + # then the exception is raised and cannot be caught. No need + # to infer it. return True exc = utils.safe_infer(node.exc) if exc is None or exc is astroid.Uninferable or not hasattr(exc, "pytype"): @@ -1313,7 +1313,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): bool: True if the node ends with an explicit statement, False otherwise. """ - # Recursion base case + # Recursion base case if isinstance(node, astroid.Return): return True if isinstance(node, astroid.Call): @@ -1324,7 +1324,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): except astroid.InferenceError: pass # Avoid the check inside while loop as we don't know - # if they will be completed + # if they will be completed if isinstance(node, astroid.While): return True if isinstance(node, astroid.Raise): @@ -1335,7 +1335,7 @@ class RefactoringChecker(checkers.BaseTokenChecker): return all( self._is_node_return_ended(_child) for _child in node.get_children() ) - # recurses on the children of the node + # recurses on the children of the node return any(self._is_node_return_ended(_child) for _child in node.get_children()) @staticmethod diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index e2e6557a9..0cae97e61 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -445,7 +445,7 @@ class StringFormatChecker(BaseChecker): def _check_new_format(self, node, func): """Check the new string formatting. """ - # Skip ormat nodes which don't have an explicit string on the + # Skip format nodes which don't have an explicit string on the # left side of the format operation. # We do this because our inference engine can't properly handle # redefinitions of the original string. diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py index b42f229c7..b6a2978a5 100644 --- a/pylint/checkers/variables.py +++ b/pylint/checkers/variables.py @@ -993,7 +993,7 @@ class VariablesChecker(BaseChecker): # the name has already been consumed, only check it's not a loop # variable used outside the loop # avoid the case where there are homonyms inside function scope and - # comprehension current scope (avoid bug #1731) + # comprehension current scope (avoid bug #1731) if name in current_consumer.consumed and not ( current_consumer.scope_type == "comprehension" and self._has_homonym_in_upper_function_scope(node, i) diff --git a/tests/checkers/unittest_python3.py b/tests/checkers/unittest_python3.py index 573e0271a..031685bbf 100644 --- a/tests/checkers/unittest_python3.py +++ b/tests/checkers/unittest_python3.py @@ -32,7 +32,7 @@ from pylint import testutils from pylint.checkers import python3 as checker from pylint.interfaces import INFERENCE, INFERENCE_FAILURE -# TODO(cpopa): Port these to the functional test framework instead. pylint: disable=fixme +# TODO(cpopa): Port these to the functional test framework instead. pylint: disable=fixme class TestPython3Checker(testutils.CheckerTestCase): diff --git a/tests/functional/l/line_too_long.py b/tests/functional/l/line_too_long.py index 4481e842a..1be460375 100644 --- a/tests/functional/l/line_too_long.py +++ b/tests/functional/l/line_too_long.py @@ -45,7 +45,7 @@ def func_with_long(parameter): return parameter
-# No line-too-long message should be emitted as the disable comment stands for all the multiline
+# No line-too-long message should be emitted as the disable comment stands for all the multiline
def issue_2957():
"""
This is a very very very long line within a docstring that should trigger a pylint C0301 error line-too-long
diff --git a/tests/functional/s/stop_iteration_inside_generator.py b/tests/functional/s/stop_iteration_inside_generator.py index 659932439..822f63369 100644 --- a/tests/functional/s/stop_iteration_inside_generator.py +++ b/tests/functional/s/stop_iteration_inside_generator.py @@ -32,15 +32,15 @@ def gen_stopiterchild(): raise RebornStopIteration # [stop-iteration-return] # pylint should warn here -# because of the possibility that next raises a StopIteration exception +# because of the possibility that next raises a StopIteration exception def gen_next_raises_stopiter(): g = gen_ok() while True: yield next(g) # [stop-iteration-return] # This one is the same as gen_next_raises_stopiter -# but is ok because the next function is inside -# a try/except block handling StopIteration +# but is ok because the next function is inside +# a try/except block handling StopIteration def gen_next_inside_try_except(): g = gen_ok() while True: @@ -50,8 +50,8 @@ def gen_next_inside_try_except(): return # This one is the same as gen_next_inside_try_except -# but is not ok because the next function is inside -# a try/except block that don't handle StopIteration +# but is not ok because the next function is inside +# a try/except block that don't handle StopIteration def gen_next_inside_wrong_try_except(): g = gen_ok() while True: @@ -61,8 +61,8 @@ def gen_next_inside_wrong_try_except(): return # This one is the same as gen_next_inside_try_except -# but is not ok because the next function is inside -# a try/except block that handle StopIteration but reraise it +# but is not ok because the next function is inside +# a try/except block that handle StopIteration but reraise it def gen_next_inside_wrong_try_except2(): g = gen_ok() while True: diff --git a/tests/functional/u/ungrouped_imports.py b/tests/functional/u/ungrouped_imports.py index d21c14839..9c0862bfd 100644 --- a/tests/functional/u/ungrouped_imports.py +++ b/tests/functional/u/ungrouped_imports.py @@ -18,7 +18,7 @@ from astroid import exceptions # [ungrouped-imports] if True: import logging.handlers # [ungrouped-imports] from os.path import join # [ungrouped-imports] -# Test related to compatibility with isort: +# Test related to compatibility with isort: # We check that we do not create error with the old way pylint was handling it import subprocess import unittest diff --git a/tests/functional/u/using_constant_test.py b/tests/functional/u/using_constant_test.py index 7e902e021..df7b56237 100644 --- a/tests/functional/u/using_constant_test.py +++ b/tests/functional/u/using_constant_test.py @@ -1,7 +1,7 @@ """Verify if constant tests are used inside if statements.""" # pylint: disable=invalid-name, missing-docstring,too-few-public-methods # pylint: disable=no-init,expression-not-assigned, useless-object-inheritance -# pylint: disable=missing-parentheses-for-call-in-test, unnecessary-comprehension, condition-evals-to-constant +# pylint: disable=missing-parentheses-for-call-in-test, unnecessary-comprehension, condition-evals-to-constant import collections @@ -8,7 +8,7 @@ deps = git+https://github.com/pycqa/astroid@master pytest commands = - # This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352 + # This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352 pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \ {toxinidir}/pylint \ {toxinidir}/tests/message/ \ |