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

Side by Side Diff: chrome/browser/PRESUBMIT.py

Issue 1870853003: Vulcanize settings (hacky and dirty, don't use) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git squash commit. Created 4 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Presubmit script for Chromium browser code. 5 """Presubmit script for Chromium browser code.
6 6
7 This script currently checks HTML/CSS/JS files in resources/ and ui/webui/. 7 This script currently checks HTML/CSS/JS files in resources/ and ui/webui/.
8 8
9 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 9 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
10 for more details about the presubmit API built into depot_tools, and see 10 for more details about the presubmit API built into depot_tools, and see
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 sys.path = [cwd] + old_path 50 sys.path = [cwd] + old_path
51 from web_dev_style import (resource_checker, css_checker, html_checker, 51 from web_dev_style import (resource_checker, css_checker, html_checker,
52 js_checker) 52 js_checker)
53 53
54 search_dirs = (resources, webui) 54 search_dirs = (resources, webui)
55 def _html_css_js_resource(p): 55 def _html_css_js_resource(p):
56 return p.endswith(('.html', '.css', '.js')) and p.startswith(search_dirs) 56 return p.endswith(('.html', '.css', '.js')) and p.startswith(search_dirs)
57 57
58 BLACKLIST = ['chrome/browser/resources/md_downloads/crisper.js', 58 BLACKLIST = ['chrome/browser/resources/md_downloads/crisper.js',
59 'chrome/browser/resources/md_downloads/vulcanized.html', 59 'chrome/browser/resources/md_downloads/vulcanized.html',
60 'chrome/browser/resources/settings/crisper.js',
61 'chrome/browser/resources/settings/vulcanized.html',
60 'chrome/browser/resources/pdf/index.html', 62 'chrome/browser/resources/pdf/index.html',
61 'chrome/browser/resources/pdf/index.js'] 63 'chrome/browser/resources/pdf/index.js']
62 def is_resource(maybe_resource): 64 def is_resource(maybe_resource):
63 return (maybe_resource.LocalPath() not in BLACKLIST and 65 return (maybe_resource.LocalPath() not in BLACKLIST and
64 _html_css_js_resource(maybe_resource.AbsoluteLocalPath())) 66 _html_css_js_resource(maybe_resource.AbsoluteLocalPath()))
65 67
66 results.extend(resource_checker.ResourceChecker( 68 results.extend(resource_checker.ResourceChecker(
67 input_api, output_api, file_filter=is_resource).RunChecks()) 69 input_api, output_api, file_filter=is_resource).RunChecks())
68 results.extend(css_checker.CSSChecker( 70 results.extend(css_checker.CSSChecker(
69 input_api, output_api, file_filter=is_resource).RunChecks()) 71 input_api, output_api, file_filter=is_resource).RunChecks())
70 results.extend(html_checker.HtmlChecker( 72 results.extend(html_checker.HtmlChecker(
71 input_api, output_api, file_filter=is_resource).RunChecks()) 73 input_api, output_api, file_filter=is_resource).RunChecks())
72 results.extend(js_checker.JSChecker( 74 results.extend(js_checker.JSChecker(
73 input_api, output_api, file_filter=is_resource).RunChecks()) 75 input_api, output_api, file_filter=is_resource).RunChecks())
74 finally: 76 finally:
75 sys.path = old_path 77 sys.path = old_path
76 78
77 return results 79 return results
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698