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

Unified Diff: chrome/browser/web_dev_style/css_checker.py

Issue 1257863004: Just remove --css-mixins: {...}; in presubmit checked contents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | chrome/browser/web_dev_style/css_checker_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_dev_style/css_checker.py
diff --git a/chrome/browser/web_dev_style/css_checker.py b/chrome/browser/web_dev_style/css_checker.py
index c41d1bdc84a343bbdadf74553995b61841d091e6..00f1b7372f9949dc96e15b382fd448d397a2e39c 100644
--- a/chrome/browser/web_dev_style/css_checker.py
+++ b/chrome/browser/web_dev_style/css_checker.py
@@ -33,6 +33,7 @@ class CSSChecker(object):
s = _remove_ats(s)
s = _remove_comments(s)
s = _remove_template_expressions(s)
+ s = _remove_mixins(s)
return s
def _remove_ats(s):
@@ -47,6 +48,9 @@ class CSSChecker(object):
def _remove_comments(s):
return re.sub(re.compile(r'/\*.*?\*/', re.DOTALL), '', s)
+ def _remove_mixins(s):
+ return re.sub(re.compile(r'--[\d\w-]+: {.*?};', re.DOTALL), '', s)
+
def _remove_template_expressions(s):
return re.sub(re.compile(r'\${[^}]*}', re.DOTALL), '', s)
@@ -70,6 +74,7 @@ class CSSChecker(object):
def alphabetize_props(contents):
errors = []
+ # TODO(dbeam): make this smart enough to detect issues in mixins.
for rule in re.finditer(r'{(.*?)}', contents, re.DOTALL):
semis = map(lambda t: t.strip(), rule.group(1).split(';'))[:-1]
rules = filter(lambda r: ': ' in r, semis)
« no previous file with comments | « no previous file | chrome/browser/web_dev_style/css_checker_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698