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

Unified Diff: build/android/lint/suppress.py

Issue 2241563005: Handle temporary file paths in suppress.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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: build/android/lint/suppress.py
diff --git a/build/android/lint/suppress.py b/build/android/lint/suppress.py
index 3926d6d3c54e8b87332c4070f3d55a3d1dc87575..3277458672094fcd64ab97c6f11c57363e6bd153 100755
--- a/build/android/lint/suppress.py
+++ b/build/android/lint/suppress.py
@@ -12,6 +12,7 @@
import collections
import optparse
import os
+import re
import sys
from xml.dom import minidom
@@ -20,7 +21,7 @@ sys.path.append(_BUILD_ANDROID_DIR)
from pylib.constants import host_paths
-
+_TMP_DIR_RE = re.compile(r'^/tmp/.*/(SRC_ROOT[0-9]+|PRODUCT_DIR)/')
_THIS_FILE = os.path.abspath(__file__)
_CONFIG_PATH = os.path.join(os.path.dirname(_THIS_FILE), 'suppressions.xml')
_DOC = (
@@ -75,9 +76,11 @@ def _ParseAndMergeResultFile(result_path, issues_dict):
issue_id = issue.attributes['id'].value
severity = issue.attributes['severity'].value
path = issue.getElementsByTagName('location')[0].attributes['file'].value
+ # Strip temporary file path and use regex instead of path.
+ regexp = re.sub(_TMP_DIR_RE, '', path)
if issue_id not in issues_dict:
issues_dict[issue_id] = _Issue(severity, set(), set())
- issues_dict[issue_id].paths.add(path)
+ issues_dict[issue_id].regexps.add(regexp)
def _WriteConfigFile(config_path, issues_dict):
« 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