Ai
2 Star 0 Fork 0

chromium_develop/chromium_third_party_pylint

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
README.chromium 2.33 KB
一键复制 编辑 原始数据 按行查看 历史
李想 提交于 2022-08-16 16:21 +08:00 . chromium origin init
URL: http://www.pylint.org/
Name: pylint
Version: 1.4.1
License: GPL v2
License File: pylint/LICENSE.txt
Security Critical: No
Description:
This directory contains the pylint module.
This code is not included in the final build. It is only used to run linting
checks on code (usually at presubmit time).
This is only used by code inside the src tree that needs to import the pylint
module directly. If you're using `pylint` to check your code (e.g. via the
PRESUBMIT.cfg file), then this copy is *not* used. That pylint comes from the
depot_tools repo instead.
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)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chromium_develop/chromium_third_party_pylint.git
git@gitee.com:chromium_develop/chromium_third_party_pylint.git
chromium_develop
chromium_third_party_pylint
chromium_third_party_pylint
master

搜索帮助