New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 749752 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 746539
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

pylint / asteroid stacktrace while linking autotest suite.py

Project Member Reported by akes...@chromium.org, Jul 27 2017

Issue description

              I:1164, 0: Locally disabling W0703 (locally-disabled)
              Traceback (most recent call last):
                File "./utils/run_pylint.py", line 479, in <module>
                  main()
                File "./utils/run_pylint.py", line 472, in main
                  pylint_base_opts)
                File "./utils/run_pylint.py", line 397, in check_committed_files
                  batch_check_files(temp_files, pylint_base_opts)
                File "./utils/run_pylint.py", line 246, in batch_check_files
                  exit=False)
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/lint.py", line 1040, in __init__
                  linter.check(args)
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/lint.py", line 626, in check
                  self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/lint.py", line 712, in check_astroid_module
                  walker.walk(astroid)
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/utils.py", line 697, in walk
                  self.walk(child)
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/utils.py", line 697, in walk
                  self.walk(child)
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/utils.py", line 694, in walk
                  cb(astroid)
                File "./utils/run_pylint.py", line 183, in visit_function
                  if _is_test_case_method(node):
                File "./utils/run_pylint.py", line 414, in _is_test_case_method
                  parent_class_names = {x.name for x in node.parent.frame().ancestors()}
                File "./utils/run_pylint.py", line 414, in <setcomp>
                  parent_class_names = {x.name for x in node.parent.frame().ancestors()}
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/astroid/scoped_nodes.py", line 810, in ancestors
                  for grandpa in baseobj.ancestors(True, context):
                File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/astroid/scoped_nodes.py", line 801, in ancestors
                  for baseobj in stmt.infer(context):
              TypeError: unbound method infer() must be called with Tuple instance as first argument (got InferenceContext instance instead)

 
Summary: pylint / asteroid stacktrace while linking autotest suite.py (was: pyling / asteroid stacktrace while linking autotest suite.py)
ToT reproduction:

$ ./utils/run_pylint.py 
************* Module files.site_utils.set_tree_status
C: 34, 0: Missing function docstring (missing-docstring)
************* Module files.site_utils.mass_update
C:111, 0: Docstring needs "@param host:" (missing-docstring)
C:111, 0: Docstring needs "@param options:" (missing-docstring)
C:122, 0: Docstring needs "@param host:" (missing-docstring)
C:122, 0: Docstring needs "@param options:" (missing-docstring)
C:143, 0: Docstring needs "@param host:" (missing-docstring)
C:160, 0: Docstring needs "@param host:" (missing-docstring)
C:177, 0: Docstring needs "@param options:" (missing-docstring)
C:201, 0: Missing function docstring (missing-docstring)
C:249, 0: Missing function docstring (missing-docstring)
W:259, 2: Specify string format arguments as logging function parameters (logging-not-lazy)
W:260, 2: Specify string format arguments as logging function parameters (logging-not-lazy)
W:282, 4: Specify string format arguments as logging function parameters (logging-not-lazy)
W:290, 6: Specify string format arguments as logging function parameters (logging-not-lazy)
W:293, 6: Specify string format arguments as logging function parameters (logging-not-lazy)
************* Module files.site_utils.rpc_flight_recorder
I: 17, 0: Locally disabling W0611 (locally-disabled)
************* Module files.site_utils.label_cleaner
C:149, 0: Missing function docstring (missing-docstring)
************* Module files.site_utils.test_that_unittest
I:  5, 0: Deprecated pragma "pylint:disable-msg" or "pylint:enable-msg" (deprecated-pragma)
I:  5, 0: Locally disabling C0111 (locally-disabled)
Traceback (most recent call last):
  File "./utils/run_pylint.py", line 479, in <module>
    main()
  File "./utils/run_pylint.py", line 474, in main
    check_dir('.', pylint_base_opts)
  File "./utils/run_pylint.py", line 301, in check_dir
    os.path.walk(dir_path, visit, base_opts)
  File "/usr/lib/python2.7/posixpath.py", line 246, in walk
    walk(name, func, arg)
  File "/usr/lib/python2.7/posixpath.py", line 238, in walk
    func(arg, top, names)
  File "./utils/run_pylint.py", line 291, in visit
    check_file(os.path.join(dirname, filename), arg)
  File "./utils/run_pylint.py", line 277, in check_file
    pylint_runner = pylint.lint.Run(base_opts + [file_path], exit=False)
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/lint.py", line 1040, in __init__
    linter.check(args)
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/lint.py", line 626, in check
    self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/lint.py", line 712, in check_astroid_module
    walker.walk(astroid)
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/utils.py", line 697, in walk
    self.walk(child)
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/utils.py", line 697, in walk
    self.walk(child)
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/pylint/utils.py", line 694, in walk
    cb(astroid)
  File "./utils/run_pylint.py", line 183, in visit_function
    if _is_test_case_method(node):
  File "./utils/run_pylint.py", line 414, in _is_test_case_method
    parent_class_names = {x.name for x in node.parent.frame().ancestors()}
  File "./utils/run_pylint.py", line 414, in <setcomp>
    parent_class_names = {x.name for x in node.parent.frame().ancestors()}
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/astroid/scoped_nodes.py", line 810, in ancestors
    for grandpa in baseobj.ancestors(True, context):
  File "/usr/local/google/home/akeshet/chromiumos/src/third_party/autotest/files/site-packages/astroid/scoped_nodes.py", line 801, in ancestors
    for baseobj in stmt.infer(context):
TypeError: unbound method infer() must be called with Tuple instance as first argument (got InferenceContext instance instead)

After Paul lands his run_pylint refactor [1] so that it works with newer versions of pylint, I can land my bump for astroid/pylint [2] which fixes this.

[1]: https://chromium-review.googlesource.com/c/437656/
[2]: https://chromium-review.googlesource.com/c/578150/
Mergedinto: 746539
Status: Duplicate (was: Untriaged)

Sign in to add a comment