Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: presubmit_canned_checks.py

Issue 1639493003: Add extensions parameter to Pylint presubmit check. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_canned_checks.py
diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py
index 96bd094c226a8ea0156a0e3b4a240105050e07f9..6ce81680f205ec457e983175fffa8cf2746f4d24 100644
--- a/presubmit_canned_checks.py
+++ b/presubmit_canned_checks.py
@@ -694,7 +694,8 @@ def _FetchAllFiles(input_api, white_list, black_list):
def GetPylint(input_api, output_api, white_list=None, black_list=None,
- disabled_warnings=None, extra_paths_list=None, pylintrc=None):
+ disabled_warnings=None, extra_paths_list=None, extensions=None,
+ pylintrc=None):
"""Run pylint on python files.
The default white_list enforces looking only at *.py files.
@@ -729,11 +730,16 @@ def GetPylint(input_api, output_api, white_list=None, black_list=None,
input_api.logging.info('Skipping pylint: no matching changes.')
return []
+ extra_args = []
+
+ if extensions:
+ extra_args.append('--extension-pkg-whitelist=' + ','.join(extensions))
+
if pylintrc is not None:
pylintrc = input_api.os_path.join(input_api.PresubmitLocalPath(), pylintrc)
else:
pylintrc = input_api.os_path.join(_HERE, 'pylintrc')
- extra_args = ['--rcfile=%s' % pylintrc]
+ extra_args.append('--rcfile=%s' % pylintrc)
if disabled_warnings:
extra_args.extend(['-d', ','.join(disabled_warnings)])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698