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

Unified Diff: PRESUBMIT.py

Issue 202773002: Presubmit check improvements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 9 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 | third_party/pylint/reporters/text.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index a56b4834a9dd2bf157b5b01fff7246e4bb5a0cd1..767eac6e74f106f13f962f5098f2a516ddb52139 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -8,6 +8,9 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into depot_tools.
"""
+import fnmatch
+import os
M-A Ruel 2014/03/18 19:29:16 Not needed.
+
def CommonChecks(input_api, output_api, tests_to_black_list):
results = []
@@ -19,6 +22,16 @@ def CommonChecks(input_api, output_api, tests_to_black_list):
r'^site-packages-py[0-9]\.[0-9][\/\\].+',
r'^svn_bin[\/\\].+',
r'^testing_support[\/\\]_rietveld[\/\\].+']
+ if os.path.exists('.gitignore'):
M-A Ruel 2014/03/18 19:29:16 input_api.os_path.exists
+ with open('.gitignore') as fh:
+ lines = [l.strip() for l in fh.readlines()]
+ black_list.extend([fnmatch.translate(l) for l in lines if
+ l and not l.startswith('#')])
+ if os.path.exists('.git/info/exclude'):
+ with open('.git/info/exclude') as fh:
+ lines = [l.strip() for l in fh.readlines()]
+ black_list.extend([fnmatch.translate(l) for l in lines if
+ l and not l.startswith('#')])
disabled_warnings = [
'R0401', # Cyclic import
'W0613', # Unused argument
« no previous file with comments | « no previous file | third_party/pylint/reporters/text.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698