You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
depot_tools/third_party/pylint
iannucci@chromium.org d61a4950b2 Changes to improve multiprocessing PRESUBMIT support in Windows
* make RunTest's multiprocessing.Pool in the constructor of InputApi
    to avoid getting tripped up by chdir manipulation.
  * Don't do the split cyclic-import check when the invoker of the
    Pylint presubmit checks explicitly sends cyclic import check
    parameters via extra_args
  * fix pseudobug where ownership of the files variable was unclear,
    and pass all arguments on stdin (instead of mix of CLI + stdin).
  * fix bug in pylint which caused it to manipulate sys.path before
    spawning its subprocesses, which caused multiprocessing to fail
    on windows.
    * Note: This may carry a slight semantic change. Before, pylint would
      add all .py files' directories to sys.path while checking any of
      them. Now in parallel mode, pylint will only add the path of the
      single file to sys.path. This behavior actually mirrors Python's
      own behavior, so the check should be more-correct than before (and
      should cut down on pylint import scanning time with very large
      sys.path's).
    * If someone encounters an issue with this, please note that the
      GetPylint check also includes an extra_paths_list which is
      expressly for this purpose.

R=dpranke@chromium.org, kbr@chromium.org, maruel@chromium.org
BUG=501012

Review URL: https://codereview.chromium.org/1208743002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295908 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
..
checkers pylint: upgrade to 1.4.1 10 years ago
pyreverse pylint: upgrade to 1.4.0 10 years ago
reporters pylint: upgrade to 1.4.1 10 years ago
LICENSE.txt Add pylint to depot_tools. 13 years ago
README.chromium Changes to improve multiprocessing PRESUBMIT support in Windows 10 years ago
__init__.py pylint: upgrade to 1.4.0 10 years ago
__main__.py Revert "Revert "pylint: upgrade to 1.3.1"" 10 years ago
__pkginfo__.py pylint: upgrade to 1.4.1 10 years ago
config.py pylint: upgrade to 1.4.0 10 years ago
epylint.py pylint: upgrade to 1.4.0 10 years ago
gui.py pylint: upgrade to 1.4.1 10 years ago
interfaces.py pylint: upgrade to 1.4.1 10 years ago
lint.py Changes to improve multiprocessing PRESUBMIT support in Windows 10 years ago
testutils.py pylint: upgrade to 1.4.0 10 years ago
utils.py pylint: upgrade to 1.4.1 10 years ago

README.chromium

URL: http://www.pylint.org/
Version: 1.4.1
License: GPL
License File: LICENSE.txt

Description:
This directory contains the pylint module.

Local Modifications:
- applied upstream fix https://bitbucket.org/logilab/pylint/commits/5df347467ee0
- applied fix to work around bad interaction between sys.path manipulation in
  pylint itself and multiprocessing's implementation on Windows (DIFF1)


Diffs:
DIFF1
diff --git a/third_party/pylint/lint.py b/third_party/pylint/lint.py
index e10ae56..082d8b3 100644
--- a/third_party/pylint/lint.py
+++ b/third_party/pylint/lint.py
@@ -671,7 +671,8 @@ class PyLinter(configuration.OptionsManagerMixIn,
             files_or_modules = (files_or_modules,)

         if self.config.jobs == 1:
-            self._do_check(files_or_modules)
+            with fix_import_path(files_or_modules):
+                self._do_check(files_or_modules)
         else:
             # Hack that permits running pylint, on Windows, with -m switch
             # and with --jobs, as in 'python -2 -m pylint .. --jobs'.
@@ -1252,8 +1253,8 @@ group are mutually exclusive.'),

         # insert current working directory to the python path to have a correct
         # behaviour
-        with fix_import_path(args):
-            if self.linter.config.profile:
+        if self.linter.config.profile:
+            with fix_import_path(args):
                 print('** profiled run', file=sys.stderr)
                 import cProfile, pstats
                 cProfile.runctx('linter.check(%r)' % args, globals(), locals(),
@@ -1262,9 +1263,9 @@ group are mutually exclusive.'),
                 data.strip_dirs()
                 data.sort_stats('time', 'calls')
                 data.print_stats(30)
-            else:
-                linter.check(args)
-            linter.generate_reports()
+        else:
+            linter.check(args)
+        linter.generate_reports()
         if exit:
             sys.exit(self.linter.msg_status)