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

Unified Diff: git_cl.py

Issue 196943006: Pass through "--filter" arguments from "git cl lint" to cpplint.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 12f2c87c998b2e6d88d638d6c4b6508f37d31b53..d513abe8df0f103d3b34f8d2b3333c7c3926c31e 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1382,7 +1382,9 @@ def CreateDescriptionFromLog(args):
def CMDlint(parser, args):
"""Runs cpplint on the current changelist."""
- _, args = parser.parse_args(args)
+ parser.add_option('--filter', action='append', default=[], metavar='-x,+y',
+ help='Comma-separated list of cpplint\'s category-filters')
+ (options, args) = parser.parse_args(args)
# Access to a protected member _XX of a client class
# pylint: disable=W0212
@@ -1403,7 +1405,8 @@ def CMDlint(parser, args):
files = [f.LocalPath() for f in change.AffectedFiles()]
# Process cpplints arguments if any.
- filenames = cpplint.ParseArguments(args + files)
+ filenames = cpplint.ParseArguments(
+ ['--filter=' + ','.join(options.filter)] + args + files)
Nico 2014/03/13 04:21:18 if options.filter has its default value of [], thi
tzik 2014/03/13 04:35:58 Ah, right. Absence of "--filter" means different t
white_regex = re.compile(settings.GetLintRegex())
black_regex = re.compile(settings.GetLintIgnoreRegex())
« 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