Hello community, here is the log from the commit of package python-pylint for openSUSE:Factory checked in at 2019-11-04 17:09:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-pylint (Old) and /work/SRC/openSUSE:Factory/.python-pylint.new.2990 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pylint" Mon Nov 4 17:09:10 2019 rev:12 rq:743455 version:2.4.3 Changes: -------- --- /work/SRC/openSUSE:Factory/python-pylint/python-pylint.changes 2019-10-10 11:52:47.135426286 +0200 +++ /work/SRC/openSUSE:Factory/.python-pylint.new.2990/python-pylint.changes 2019-11-04 17:09:12.224440436 +0100 @@ -1,0 +2,13 @@ +Sun Oct 27 08:30:00 UTC 2019 - Michael Ströder <mich...@stroeder.com> + +- Update to 2.4.3: + * Fix an issue with ``unnecessary-comprehension`` in comprehensions with additional repacking of elements. + * ``import-outside-toplevel`` is emitted for ``ImportFrom`` nodes as well. + * Do not emit ``no-method-argument`` for functions using positional only args. + * ``consider-using-sys-exit`` is no longer emitted when `exit` is imported in the local scope. + * `invalid-overridden-method` takes `abc.abstractproperty` in account + * Fixed ``missing-yield-type-doc`` getting incorrectly raised when + a generator does not document a yield type but has a type annotation. + * ``typing.overload`` functions are exempted from ``too-many-function-args`` + +------------------------------------------------------------------- Old: ---- pylint-2.4.2.tar.gz New: ---- pylint-2.4.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pylint.spec ++++++ --- /var/tmp/diff_new_pack.BWSaX4/_old 2019-11-04 17:09:13.632441940 +0100 +++ /var/tmp/diff_new_pack.BWSaX4/_new 2019-11-04 17:09:13.664441974 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 Name: python-pylint -Version: 2.4.2 +Version: 2.4.3 Release: 0 Summary: Syntax and style checker for Python code License: GPL-2.0-or-later ++++++ pylint-2.4.2.tar.gz -> pylint-2.4.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/CONTRIBUTORS.txt new/pylint-2.4.3/CONTRIBUTORS.txt --- old/pylint-2.4.2/CONTRIBUTORS.txt 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/CONTRIBUTORS.txt 2019-10-18 11:26:14.000000000 +0200 @@ -329,3 +329,5 @@ * Trevor Bekolay: contributor - Added --list-msgs-enabled command + +* Rémi Cardona: contributor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/ChangeLog new/pylint-2.4.3/ChangeLog --- old/pylint-2.4.2/ChangeLog 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/ChangeLog 2019-10-18 11:26:14.000000000 +0200 @@ -2,6 +2,42 @@ Pylint's ChangeLog ------------------ +What's New in Pylint 2.4.3? +=========================== + +Release date: 2019-10-18 + +* Fix an issue with ``unnecessary-comprehension`` in comprehensions with additional repacking of elements. + + Close #3148 + +* ``import-outside-toplevel`` is emitted for ``ImportFrom`` nodes as well. + + Close #3175 + + +* Do not emit ``no-method-argument`` for functions using positional only args. + + Close #3161 + +* ``consider-using-sys-exit`` is no longer emitted when `exit` is imported in the local scope. + + Close #3147 + +* `invalid-overridden-method` takes `abc.abstractproperty` in account + + Close #3150 + +* Fixed ``missing-yield-type-doc`` getting incorrectly raised when + a generator does not document a yield type but has a type annotation. + + Closes #3185 + +* ``typing.overload`` functions are exempted from ``too-many-function-args`` + + Close #3170 + + What's New in Pylint 2.4.2? =========================== @@ -334,7 +370,7 @@ * Allow the choice of f-strings as a valid way of formatting logging strings. -Closes #2395 + Closes #2395 * Added ``--list-msgs-enabled`` command to list all enabled and disabled messages given the current RC file and command line arguments. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/PKG-INFO new/pylint-2.4.3/PKG-INFO --- old/pylint-2.4.2/PKG-INFO 2019-09-30 11:10:00.000000000 +0200 +++ new/pylint-2.4.3/PKG-INFO 2019-10-18 11:29:19.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pylint -Version: 2.4.2 +Version: 2.4.3 Summary: python code static checker Home-page: https://github.com/PyCQA/pylint Author: Python Code Quality Authority diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/__init__.py new/pylint-2.4.3/pylint/__init__.py --- old/pylint-2.4.2/pylint/__init__.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/__init__.py 2019-10-18 11:26:14.000000000 +0200 @@ -9,35 +9,35 @@ import sys -from .__pkginfo__ import version as __version__ +from pylint.__pkginfo__ import version as __version__ +from pylint.checkers.similar import Run as SimilarRun +from pylint.epylint import Run as EpylintRun +from pylint.lint import Run as PylintRun +from pylint.pyreverse.main import Run as PyreverseRun def run_pylint(): """run pylint""" - from pylint.lint import Run try: - Run(sys.argv[1:]) + PylintRun(sys.argv[1:]) except KeyboardInterrupt: sys.exit(1) def run_epylint(): """run pylint""" - from pylint.epylint import Run - Run() + EpylintRun() def run_pyreverse(): """run pyreverse""" - from pylint.pyreverse.main import Run - Run(sys.argv[1:]) + PyreverseRun(sys.argv[1:]) def run_symilar(): """run symilar""" - from pylint.checkers.similar import Run - Run(sys.argv[1:]) + SimilarRun(sys.argv[1:]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/__pkginfo__.py new/pylint-2.4.3/pylint/__pkginfo__.py --- old/pylint-2.4.2/pylint/__pkginfo__.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/__pkginfo__.py 2019-10-18 11:26:14.000000000 +0200 @@ -22,7 +22,7 @@ from os.path import join # For an official release, use dev_version = None -numversion = (2, 4, 2) +numversion = (2, 4, 3) dev_version = None version = ".".join(str(num) for num in numversion) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/base.py new/pylint-2.4.3/pylint/checkers/base.py --- old/pylint-2.4.2/pylint/checkers/base.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/base.py 2019-10-18 11:26:14.000000000 +0200 @@ -52,7 +52,7 @@ import pylint.utils as lint_utils from pylint import checkers, exceptions, interfaces from pylint.checkers import utils -from pylint.checkers.utils import is_property_deleter, is_property_setter +from pylint.checkers.utils import is_property_setter_or_deleter from pylint.reporters.ureports import nodes as reporter_nodes @@ -316,7 +316,7 @@ if not node.is_method(): return "function" - if is_property_setter(node) or is_property_deleter(node): + if is_property_setter_or_deleter(node): # If the function is decorated using the prop_method.{setter,getter} # form, treat it like an attribute as well. return "attr" @@ -2013,7 +2013,7 @@ def visit_functiondef(self, node): if self.config.no_docstring_rgx.match(node.name) is None: ftype = "method" if node.is_method() else "function" - if is_property_setter(node) or is_property_deleter(node): + if is_property_setter_or_deleter(node): return if isinstance(node.parent.frame(), astroid.ClassDef): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/classes.py new/pylint-2.4.3/pylint/checkers/classes.py --- old/pylint-2.4.2/pylint/checkers/classes.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/classes.py 2019-10-18 11:26:14.000000000 +0200 @@ -1460,7 +1460,12 @@ # don't care about functions with unknown argument (builtins) if node.args.args is None: return - first_arg = node.args.args and node.argnames()[0] + if node.args.args: + first_arg = node.argnames()[0] + elif node.args.posonlyargs: + first_arg = node.args.posonlyargs[0].name + else: + first_arg = None self._first_attrs.append(first_arg) first = self._first_attrs[-1] # static method @@ -1474,7 +1479,7 @@ return self._first_attrs[-1] = None # class / regular method with no args - elif not node.args.args: + elif not node.args.args and not node.args.posonlyargs: self.add_message("no-method-argument", node=node) # metaclass elif metaclass: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/imports.py new/pylint-2.4.3/pylint/checkers/imports.py --- old/pylint-2.4.2/pylint/checkers/imports.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/imports.py 2019-10-18 11:26:14.000000000 +0200 @@ -520,6 +520,7 @@ self._check_wildcard_imports(node, imported_module) self._check_same_line_imports(node) self._check_reimport(node, basename=basename, level=node.level) + self._check_toplevel(node) if isinstance(node.parent, astroid.Module): # Allow imports nested diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/refactoring.py new/pylint-2.4.3/pylint/checkers/refactoring.py --- old/pylint-2.4.2/pylint/checkers/refactoring.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/refactoring.py 2019-10-18 11:26:14.000000000 +0200 @@ -686,13 +686,20 @@ self._check_consider_using_comprehension_constructor(node) self._check_quit_exit_call(node) + @staticmethod + def _has_exit_in_scope(scope): + exit_func = scope.locals.get("exit") + return bool( + exit_func and isinstance(exit_func[0], (astroid.ImportFrom, astroid.Import)) + ) + def _check_quit_exit_call(self, node): + if isinstance(node.func, astroid.Name) and node.func.name in BUILTIN_EXIT_FUNCS: - # If we have `exit` imported from `sys` in the scope, exempt this instance. - scope = node.root() - exit_func = scope.locals.get("exit") - if exit_func and isinstance( - exit_func[0], (astroid.ImportFrom, astroid.Import) + # If we have `exit` imported from `sys` in the current or global scope, exempt this instance. + local_scope = node.scope() + if self._has_exit_in_scope(local_scope) or self._has_exit_in_scope( + node.root() ): return self.add_message("consider-using-sys-exit", node=node) @@ -1047,15 +1054,14 @@ elif isinstance(node.parent, (astroid.ListComp, astroid.SetComp)): expr = node.parent.elt - expr_list = ( - expr.name - if isinstance(expr, astroid.Name) - else ( - [elt.name for elt in expr.elts if isinstance(elt, astroid.Name)] - if isinstance(expr, astroid.Tuple) - else [] - ) - ) + if isinstance(expr, astroid.Name): + expr_list = expr.name + elif isinstance(expr, astroid.Tuple): + if any(not isinstance(elt, astroid.Name) for elt in expr.elts): + return + expr_list = [elt.name for elt in expr.elts] + else: + expr_list = [] target = node.parent.generators[0].target target_list = ( target.name diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/similar.py new/pylint-2.4.3/pylint/checkers/similar.py --- old/pylint-2.4.2/pylint/checkers/similar.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/similar.py 2019-10-18 11:26:14.000000000 +0200 @@ -19,6 +19,7 @@ import sys from collections import defaultdict +from getopt import getopt from itertools import groupby import astroid @@ -412,7 +413,6 @@ """standalone command line access point""" if argv is None: argv = sys.argv[1:] - from getopt import getopt s_opts = "hdi" l_opts = ( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/typecheck.py new/pylint-2.4.3/pylint/checkers/typecheck.py --- old/pylint-2.4.2/pylint/checkers/typecheck.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/typecheck.py 2019-10-18 11:26:14.000000000 +0200 @@ -65,6 +65,7 @@ is_inside_abstract_class, is_iterable, is_mapping, + is_overload_stub, is_super, node_ignores_exception, safe_infer, @@ -1123,7 +1124,7 @@ if calling_parg_names != called_param_names[: len(calling_parg_names)]: self.add_message("arguments-out-of-order", node=node, args=()) - # pylint: disable=too-many-branches + # pylint: disable=too-many-branches,too-many-locals @check_messages(*(list(MSGS.keys()))) def visit_call(self, node): """check that called functions/methods are inferred to callable objects, @@ -1185,6 +1186,7 @@ num_positional_args = len(call_site.positional_arguments) keyword_args = list(call_site.keyword_arguments.keys()) + overload_function = is_overload_stub(called) # Determine if we don't have a context for our call and we use variadics. node_scope = node.scope() @@ -1251,11 +1253,12 @@ # parameter. break else: - # Too many positional arguments. - self.add_message( - "too-many-function-args", node=node, args=(callable_name,) - ) - break + if not overload_function: + # Too many positional arguments. + self.add_message( + "too-many-function-args", node=node, args=(callable_name,) + ) + break # 2. Match the keyword arguments. for keyword in keyword_args: @@ -1290,7 +1293,7 @@ elif called.args.kwarg is not None: # The keyword argument gets assigned to the **kwargs parameter. pass - else: + elif not overload_function: # Unexpected keyword argument. self.add_message( "unexpected-keyword-arg", node=node, args=(keyword, callable_name) @@ -1315,7 +1318,7 @@ display_name = "<tuple>" else: display_name = repr(name) - if not has_no_context_positional_variadic: + if not has_no_context_positional_variadic and not overload_function: self.add_message( "no-value-for-parameter", node=node, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/checkers/utils.py new/pylint-2.4.3/pylint/checkers/utils.py --- old/pylint-2.4.2/pylint/checkers/utils.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/checkers/utils.py 2019-10-18 11:26:14.000000000 +0200 @@ -706,8 +706,6 @@ if not node.decorators: return False for decorator in node.decorators.nodes: - if not isinstance(decorator, astroid.Name): - continue try: if _is_property_decorator(decorator): return True @@ -731,11 +729,6 @@ return _is_property_kind(node, "setter") -def is_property_deleter(node: astroid.FunctionDef) -> bool: - """Check if the given node is a property deleter""" - return _is_property_kind(node, "deleter") - - def is_property_setter_or_deleter(node: astroid.FunctionDef) -> bool: """Check if the given node is either a property setter or a deleter""" return _is_property_kind(node, "setter", "deleter") @@ -755,7 +748,10 @@ return False -def decorated_with(func: astroid.FunctionDef, qnames: Iterable[str]) -> bool: +def decorated_with( + func: Union[astroid.FunctionDef, astroid.BoundMethod, astroid.UnboundMethod], + qnames: Iterable[str], +) -> bool: """Determine if the `func` node has a decorator with the qualified name `qname`.""" decorators = func.decorators.nodes if func.decorators else [] for decorator_node in decorators: @@ -1239,9 +1235,8 @@ :param node: Node to check. :returns: True if node is an overload function stub. False otherwise. """ - return isinstance(node, astroid.FunctionDef) and decorated_with( - node, ["typing.overload"] - ) + decorators = getattr(node, "decorators", None) + return bool(decorators and decorated_with(node, ["typing.overload", "overload"])) def is_protocol_class(cls: astroid.node_classes.NodeNG) -> bool: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/extensions/docparams.py new/pylint-2.4.3/pylint/extensions/docparams.py --- old/pylint-2.4.2/pylint/extensions/docparams.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/extensions/docparams.py 2019-10-18 11:26:14.000000000 +0200 @@ -316,7 +316,7 @@ if not doc_has_yields: self.add_message("missing-yield-doc", node=func_node) - if not doc_has_yields_type: + if not (doc_has_yields_type or func_node.returns): self.add_message("missing-yield-type-doc", node=func_node) def visit_yieldfrom(self, node): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/lint.py new/pylint-2.4.3/pylint/lint.py --- old/pylint-2.4.2/pylint/lint.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/lint.py 2019-10-18 11:26:14.000000000 +0200 @@ -73,7 +73,7 @@ from astroid.__pkginfo__ import version as astroid_version from astroid.builder import AstroidBuilder -from pylint import checkers, config, exceptions, interfaces, reporters +from pylint import __pkginfo__, checkers, config, exceptions, interfaces, reporters from pylint.__pkginfo__ import version from pylint.constants import MAIN_CHECKER_NAME, MSG_TYPES, OPTION_RGX from pylint.message import Message, MessageDefinitionStore, MessagesHandlerMixIn @@ -1761,8 +1761,6 @@ def cb_generate_manpage(self, *args, **kwargs): """optik callback for sample config file generation""" - from pylint import __pkginfo__ - self.linter.generate_manpage(__pkginfo__) sys.exit(0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint/reporters/__init__.py new/pylint-2.4.3/pylint/reporters/__init__.py --- old/pylint-2.4.2/pylint/reporters/__init__.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/pylint/reporters/__init__.py 2019-10-18 11:26:14.000000000 +0200 @@ -19,6 +19,7 @@ """utilities methods and classes for reporters""" +from pylint import utils from pylint.reporters.base_reporter import BaseReporter from pylint.reporters.collecting_reporter import CollectingReporter from pylint.reporters.json_reporter import JSONReporter @@ -27,8 +28,6 @@ def initialize(linter): """initialize linter with reporters in this package """ - from pylint import utils - utils.register_plugins(linter, __path__[0]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint.egg-info/PKG-INFO new/pylint-2.4.3/pylint.egg-info/PKG-INFO --- old/pylint-2.4.2/pylint.egg-info/PKG-INFO 2019-09-30 11:09:59.000000000 +0200 +++ new/pylint-2.4.3/pylint.egg-info/PKG-INFO 2019-10-18 11:29:18.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: pylint -Version: 2.4.2 +Version: 2.4.3 Summary: python code static checker Home-page: https://github.com/PyCQA/pylint Author: Python Code Quality Authority diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/pylint.egg-info/SOURCES.txt new/pylint-2.4.3/pylint.egg-info/SOURCES.txt --- old/pylint-2.4.2/pylint.egg-info/SOURCES.txt 2019-09-30 11:09:59.000000000 +0200 +++ new/pylint-2.4.3/pylint.egg-info/SOURCES.txt 2019-10-18 11:29:18.000000000 +0200 @@ -338,6 +338,7 @@ tests/functional/c/consider_using_sys_exit.py tests/functional/c/consider_using_sys_exit.txt tests/functional/c/consider_using_sys_exit_exempted.py +tests/functional/c/consider_using_sys_exit_local_scope.py tests/functional/c/continue_in_finally.py tests/functional/c/continue_in_finally.txt tests/functional/c/control_pragmas.py @@ -639,6 +640,8 @@ tests/functional/n/no_else_raise.txt tests/functional/n/no_else_return.py tests/functional/n/no_else_return.txt +tests/functional/n/no_method_argument_py38.py +tests/functional/n/no_method_argument_py38.rc tests/functional/n/no_name_in_module.py tests/functional/n/no_name_in_module.txt tests/functional/n/no_self_argument_py37.py @@ -867,6 +870,7 @@ tests/functional/too/too_many_arguments_issue_1045.py tests/functional/too/too_many_arguments_issue_1045.rc tests/functional/too/too_many_arguments_issue_1045.txt +tests/functional/too/too_many_arguments_overload.py tests/functional/too/too_many_boolean_expressions.py tests/functional/too/too_many_boolean_expressions.txt tests/functional/too/too_many_branches.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/extensions/test_check_return_docs.py new/pylint-2.4.3/tests/extensions/test_check_return_docs.py --- old/pylint-2.4.2/tests/extensions/test_check_return_docs.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/extensions/test_check_return_docs.py 2019-10-18 11:26:14.000000000 +0200 @@ -76,21 +76,6 @@ ): self.checker.visit_return(return_node) - def test_sphinx_returns_annotations(self): - node = astroid.extract_node( - ''' - def my_func(self) -> bool: - """This is a docstring. - - :returns: Always False - """ - return False - ''' - ) - return_node = node.body[0] - with self.assertNoMessages(): - self.checker.visit_return(return_node) - def test_sphinx_missing_return_type_with_annotations(self): node = astroid.extract_node( ''' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/extensions/test_check_yields_docs.py new/pylint-2.4.3/tests/extensions/test_check_yields_docs.py --- old/pylint-2.4.2/tests/extensions/test_check_yields_docs.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/extensions/test_check_yields_docs.py 2019-10-18 11:26:14.000000000 +0200 @@ -445,3 +445,38 @@ ) with self.assertAddsMessages(Message(msg_id="redundant-yields-doc", node=node)): self.checker.visit_functiondef(node) + + def test_sphinx_missing_yield_type_with_annotations(self): + node = astroid.extract_node( + ''' + import typing + + def generator() -> typing.Iterator[int]: + """A simple function for checking type hints. + + :returns: The number 0 + """ + yield 0 + ''' + ) + yield_node = node.body[0] + with self.assertNoMessages(): + self.checker.visit_yield(yield_node) + + def test_google_missing_yield_type_with_annotations(self): + node = astroid.extract_node( + ''' + import typing + + def generator() -> typing.Iterator[int]: + """A simple function for checking type hints. + + Yields: + The number 0 + """ + yield 0 + ''' + ) + yield_node = node.body[0] + with self.assertNoMessages(): + self.checker.visit_yield(yield_node) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/b/bad_reversed_sequence.py new/pylint-2.4.3/tests/functional/b/bad_reversed_sequence.py --- old/pylint-2.4.2/tests/functional/b/bad_reversed_sequence.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/b/bad_reversed_sequence.py 2019-10-18 11:26:14.000000000 +0200 @@ -1,9 +1,9 @@ """ Checks that reversed() receive proper argument """ # pylint: disable=missing-docstring, useless-object-inheritance # pylint: disable=too-few-public-methods,no-self-use,no-absolute-import -from collections import deque +from collections import deque, OrderedDict +from enum import IntEnum -__revision__ = 0 class GoodReversed(object): """ Implements __reversed__ """ @@ -61,8 +61,6 @@ def test_dict_ancestor_and_reversed(): """Don't emit for subclasses of dict, with __reversed__ implemented.""" - from collections import OrderedDict - class Child(dict): def __reversed__(self): return reversed(range(10)) @@ -73,8 +71,6 @@ def test_dont_emit_for_reversing_enums(): """Don't emit when reversing enum classes""" - from enum import IntEnum - class Color(IntEnum): RED = 1 GREEN = 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/b/bugfix_local_scope_metaclass_1177.py new/pylint-2.4.3/tests/functional/b/bugfix_local_scope_metaclass_1177.py --- old/pylint-2.4.2/tests/functional/b/bugfix_local_scope_metaclass_1177.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/b/bugfix_local_scope_metaclass_1177.py 2019-10-18 11:26:14.000000000 +0200 @@ -1,5 +1,5 @@ # pylint: disable=missing-docstring,too-few-public-methods,import-error -from UNINFERABLE import ImportedMetaclass +from UNINFERABLE import ImportedMetaclass, ImportedMetaclass2 class Meta(type): @@ -48,8 +48,6 @@ def imported_and_nested_scope2(): - from UNINFERABLE import ImportedMetaclass2 - class ClassImp3(metaclass=ImportedMetaclass2): pass diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/c/consider_using_enumerate.py new/pylint-2.4.3/tests/functional/c/consider_using_enumerate.py --- old/pylint-2.4.2/tests/functional/c/consider_using_enumerate.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/c/consider_using_enumerate.py 2019-10-18 11:26:14.000000000 +0200 @@ -49,6 +49,7 @@ for index in range(len(iterable)): yield other_obj[index] + # pylint: disable=import-outside-toplevel from unknown import unknown for index in range(unknown(iterable)): yield iterable[index] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/c/consider_using_sys_exit_local_scope.py new/pylint-2.4.3/tests/functional/c/consider_using_sys_exit_local_scope.py --- old/pylint-2.4.2/tests/functional/c/consider_using_sys_exit_local_scope.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.4.3/tests/functional/c/consider_using_sys_exit_local_scope.py 2019-10-18 11:26:14.000000000 +0200 @@ -0,0 +1,5 @@ +# pylint: disable=missing-docstring,import-outside-toplevel,redefined-builtin + +def run(): + from sys import exit + exit() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/i/invalid_overridden_method.py new/pylint-2.4.3/tests/functional/i/invalid_overridden_method.py --- old/pylint-2.4.2/tests/functional/i/invalid_overridden_method.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/i/invalid_overridden_method.py 2019-10-18 11:26:14.000000000 +0200 @@ -51,3 +51,10 @@ @close.deleter def close(self): return None + + +class AbstractProperty: + + @abc.abstractproperty + def prop(self): + return diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/import_outside_toplevel.py new/pylint-2.4.3/tests/functional/import_outside_toplevel.py --- old/pylint-2.4.2/tests/functional/import_outside_toplevel.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/import_outside_toplevel.py 2019-10-18 11:26:14.000000000 +0200 @@ -32,3 +32,7 @@ def k(flag): if flag: import tabnanny # [import-outside-toplevel] + + +def j(): + from collections import defaultdict # [import-outside-toplevel] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/import_outside_toplevel.txt new/pylint-2.4.3/tests/functional/import_outside_toplevel.txt --- old/pylint-2.4.2/tests/functional/import_outside_toplevel.txt 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/import_outside_toplevel.txt 2019-10-18 11:26:14.000000000 +0200 @@ -5,3 +5,4 @@ import-outside-toplevel:26:C:Import outside toplevel (tokenize) import-outside-toplevel:29:C.j:Import outside toplevel (turtle) import-outside-toplevel:34:k:Import outside toplevel (tabnanny) +import-outside-toplevel:38:j:Import outside toplevel (collections) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/n/no_method_argument_py38.py new/pylint-2.4.3/tests/functional/n/no_method_argument_py38.py --- old/pylint-2.4.2/tests/functional/n/no_method_argument_py38.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.4.3/tests/functional/n/no_method_argument_py38.py 2019-10-18 11:26:14.000000000 +0200 @@ -0,0 +1,6 @@ +# pylint: disable=missing-docstring,too-few-public-methods + + +class Cls: + def __init__(self, obj, /): + self.obj = obj diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/n/no_method_argument_py38.rc new/pylint-2.4.3/tests/functional/n/no_method_argument_py38.rc --- old/pylint-2.4.2/tests/functional/n/no_method_argument_py38.rc 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.4.3/tests/functional/n/no_method_argument_py38.rc 2019-10-18 11:26:14.000000000 +0200 @@ -0,0 +1,2 @@ +[testoptions] +min_pyver=3.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/r/redefined_outer_name_type_checking.py new/pylint-2.4.3/tests/functional/r/redefined_outer_name_type_checking.py --- old/pylint-2.4.2/tests/functional/r/redefined_outer_name_type_checking.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/r/redefined_outer_name_type_checking.py 2019-10-18 11:26:14.000000000 +0200 @@ -8,6 +8,7 @@ class Cls: def func(self, stuff: defaultdict): # This import makes the definition work. + # pylint: disable=import-outside-toplevel from collections import defaultdict obj = defaultdict() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/s/string_formatting.py new/pylint-2.4.3/tests/functional/s/string_formatting.py --- old/pylint-2.4.2/tests/functional/s/string_formatting.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/s/string_formatting.py 2019-10-18 11:26:14.000000000 +0200 @@ -134,7 +134,7 @@ trying to infer EmptyNodes (resulted after mocking the members of namedtuples). """ - from collections import namedtuple + from collections import namedtuple # pylint: disable=import-outside-toplevel class Crash(namedtuple("C", "foo bar")): """ Looking for attributes in __str__ will crash, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/s/string_formatting_py3.py new/pylint-2.4.3/tests/functional/s/string_formatting_py3.py --- old/pylint-2.4.2/tests/functional/s/string_formatting_py3.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/s/string_formatting_py3.py 2019-10-18 11:26:14.000000000 +0200 @@ -17,5 +17,5 @@ def issue_957_uninferable(): - from butchery import meat + from butchery import meat # pylint: disable=import-outside-toplevel print('%s%s%s' % ('eggs', *meat)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/too/too_many_arguments_overload.py new/pylint-2.4.3/tests/functional/too/too_many_arguments_overload.py --- old/pylint-2.4.2/tests/functional/too/too_many_arguments_overload.py 1970-01-01 01:00:00.000000000 +0100 +++ new/pylint-2.4.3/tests/functional/too/too_many_arguments_overload.py 2019-10-18 11:26:14.000000000 +0200 @@ -0,0 +1,38 @@ +# pylint: disable=missing-function-docstring,missing-module-docstring,missing-class-docstring +# pylint: disable=too-few-public-methods +from typing import overload + + +class ClassA: + @classmethod + @overload + def method(cls, arg1): + pass + + @classmethod + @overload + def method(cls, arg1, arg2): + pass + + @classmethod + def method(cls, arg1, arg2=None): + pass + + +ClassA.method(1, 2) + + +class ClassB: + @overload + def method(self, arg1): + pass + + @overload + def method(self, arg1, arg2): + pass + + def method(self, arg1, arg2=None): + pass + + +ClassB().method(1, arg2=2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/u/unbalanced_tuple_unpacking.py new/pylint-2.4.3/tests/functional/u/unbalanced_tuple_unpacking.py --- old/pylint-2.4.2/tests/functional/u/unbalanced_tuple_unpacking.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/u/unbalanced_tuple_unpacking.py 2019-10-18 11:26:14.000000000 +0200 @@ -2,7 +2,7 @@ from __future__ import absolute_import from functional.u.unpacking import unpack -# pylint: disable=using-constant-test, useless-object-inheritance +# pylint: disable=using-constant-test, useless-object-inheritance,import-outside-toplevel def do_stuff(): """This is not right.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/u/unnecessary_comprehension.py new/pylint-2.4.3/tests/functional/u/unnecessary_comprehension.py --- old/pylint-2.4.2/tests/functional/u/unnecessary_comprehension.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/u/unnecessary_comprehension.py 2019-10-18 11:26:14.000000000 +0200 @@ -11,6 +11,7 @@ [x for x in iterable if condition] # exclude comp_if [y for x in iterable for y in x] # exclude nested comprehensions [2 * x for x in iterable] # exclude useful comprehensions +[(x, y, 1) for x, y in iterable] # exclude useful comprehensions # Set comprehensions {x for x in iterable} # [unnecessary-comprehension] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/functional/u/unnecessary_comprehension.txt new/pylint-2.4.3/tests/functional/u/unnecessary_comprehension.txt --- old/pylint-2.4.2/tests/functional/u/unnecessary_comprehension.txt 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/functional/u/unnecessary_comprehension.txt 2019-10-18 11:26:14.000000000 +0200 @@ -1,8 +1,8 @@ unnecessary-comprehension:5::Unnecessary use of a comprehension unnecessary-comprehension:8::Unnecessary use of a comprehension unnecessary-comprehension:9::Unnecessary use of a comprehension -unnecessary-comprehension:16::Unnecessary use of a comprehension -unnecessary-comprehension:19::Unnecessary use of a comprehension +unnecessary-comprehension:17::Unnecessary use of a comprehension unnecessary-comprehension:20::Unnecessary use of a comprehension -unnecessary-comprehension:28::Unnecessary use of a comprehension -unnecessary-comprehension:30::Unnecessary use of a comprehension +unnecessary-comprehension:21::Unnecessary use of a comprehension +unnecessary-comprehension:29::Unnecessary use of a comprehension +unnecessary-comprehension:31::Unnecessary use of a comprehension diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pylint-2.4.2/tests/input/func_w0401_disabled_in_func.py new/pylint-2.4.3/tests/input/func_w0401_disabled_in_func.py --- old/pylint-2.4.2/tests/input/func_w0401_disabled_in_func.py 2019-09-30 11:07:07.000000000 +0200 +++ new/pylint-2.4.3/tests/input/func_w0401_disabled_in_func.py 2019-10-18 11:26:14.000000000 +0200 @@ -1,6 +1,6 @@ """Test disabling of cyclic import check inside a function """ -# pylint: disable=no-absolute-import +# pylint: disable=no-absolute-import,import-outside-toplevel from __future__ import print_function