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

Unified Diff: tools/heapcheck/PRESUBMIT.py

Issue 3343020: Add a presubmit check to look for duplicate Valgrind/Heapchecker suppression name... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | tools/valgrind/memcheck/PRESUBMIT.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/heapcheck/PRESUBMIT.py
===================================================================
--- tools/heapcheck/PRESUBMIT.py (revision 59174)
+++ tools/heapcheck/PRESUBMIT.py (working copy)
@@ -9,6 +9,7 @@
def CheckChange(input_api, output_api):
"""Checks the memcheck suppressions files for bad data."""
+ suppressions = {}
errors = []
skip_next_line = False
func_re = input_api.re.compile('[a-z_.]+\(.+\)$')
@@ -19,6 +20,13 @@
continue
if skip_next_line:
+ if suppressions.has_key(line):
+ errors.append('suppression with name "%s" at %s line %s has already '
+ 'been defined at line %s' % (line, f.LocalPath(),
+ line_num,
+ suppressions[line][1]))
+ else:
+ suppressions[line] = (f, line_num)
skip_next_line = False
continue
if line == '{':
« no previous file with comments | « no previous file | tools/valgrind/memcheck/PRESUBMIT.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698