Chromium Code Reviews| Index: chrome/browser/resources/PRESUBMIT.py |
| diff --git a/chrome/browser/resources/PRESUBMIT.py b/chrome/browser/resources/PRESUBMIT.py |
| index 82a6184ff070db348e7bf87f4b9cb2d9e6ee1ffd..6480ad6a5d992e0cb524c6d61b66155a9a430295 100644 |
| --- a/chrome/browser/resources/PRESUBMIT.py |
| +++ b/chrome/browser/resources/PRESUBMIT.py |
| @@ -44,6 +44,9 @@ def _CommonChecks(input_api, output_api): |
| sys.path.insert(0, resources) |
| from web_dev_style import css_checker, js_checker |
| + def is_resource(f): |
| + return f.AbsoluteLocalPath().endswith(('.css', '.html', '.js')) |
|
Marc-Antoine Ruel (Google)
2012/03/31 23:11:17
return f.LocalPath().endswith(('.css', '.html', '.
Dan Beam
2012/04/01 01:55:44
OK, will fix when in corp.
Dan Beam
2012/04/01 23:22:02
Done.
|
| + |
| # TODO(dbeam): Remove this directory filter eventually when ready. |
| dirs = ( |
| path.join(resources, 'extensions'), |
| @@ -53,14 +56,13 @@ def _CommonChecks(input_api, output_api): |
| path.join(resources, 'options2'), |
| path.join(resources, 'uber'), |
| ) |
| - def file_filter(affected_file): |
| - f = affected_file.AbsoluteLocalPath() |
| - return (f.startswith(dirs) and f.endswith(('.css', '.html', '.js'))) |
| + def certain_dirs(f): |
| + return is_resource(f) and f.AbsoluteLocalPath().startswith(dirs) |
|
Marc-Antoine Ruel (Google)
2012/03/31 23:11:17
same
Dan Beam
2012/04/01 01:55:44
We do need to get this full path to support people
Marc-Antoine Ruel (Google)
2012/04/01 12:40:12
Ugh, ok.
lgtm
|
| results.extend(css_checker.CSSChecker(input_api, output_api, |
| - file_filter=file_filter).RunChecks()) |
| + file_filter=is_resource).RunChecks()) |
| results.extend(js_checker.JSChecker(input_api, output_api, |
| - file_filter=file_filter).RunChecks()) |
| + file_filter=certain_dirs).RunChecks()) |
| finally: |
| sys.path = old_path |