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

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

Issue 9923005: [WebUI] Fix rest of CSS style nits so I can turn on CSS checker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: padding fixes, remove a no-op change Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 WebUI resources. 5 """Presubmit script for Chromium WebUI resources.
6 6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
8 for more details about the presubmit API built into gcl/git cl, and see 8 for more details about the presubmit API built into gcl/git cl, and see
9 http://www.chromium.org/developers/web-development-style-guide for the rules 9 http://www.chromium.org/developers/web-development-style-guide for the rules
10 we're checking against here. 10 we're checking against here.
(...skipping 26 matching lines...) Expand all
37 results.extend( 37 results.extend(
38 input_api.canned_checks.RunUnitTests(input_api, output_api, tests)) 38 input_api.canned_checks.RunUnitTests(input_api, output_api, tests))
39 39
40 import sys 40 import sys
41 old_path = sys.path 41 old_path = sys.path
42 42
43 try: 43 try:
44 sys.path.insert(0, resources) 44 sys.path.insert(0, resources)
45 from web_dev_style import css_checker, js_checker 45 from web_dev_style import css_checker, js_checker
46 46
47 def is_resource(f):
48 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.
49
47 # TODO(dbeam): Remove this directory filter eventually when ready. 50 # TODO(dbeam): Remove this directory filter eventually when ready.
48 dirs = ( 51 dirs = (
49 path.join(resources, 'extensions'), 52 path.join(resources, 'extensions'),
50 path.join(resources, 'help'), 53 path.join(resources, 'help'),
51 path.join(resources, 'net_internals'), 54 path.join(resources, 'net_internals'),
52 path.join(resources, 'ntp4'), 55 path.join(resources, 'ntp4'),
53 path.join(resources, 'options2'), 56 path.join(resources, 'options2'),
54 path.join(resources, 'uber'), 57 path.join(resources, 'uber'),
55 ) 58 )
56 def file_filter(affected_file): 59 def certain_dirs(f):
57 f = affected_file.AbsoluteLocalPath() 60 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
58 return (f.startswith(dirs) and f.endswith(('.css', '.html', '.js')))
59 61
60 results.extend(css_checker.CSSChecker(input_api, output_api, 62 results.extend(css_checker.CSSChecker(input_api, output_api,
61 file_filter=file_filter).RunChecks()) 63 file_filter=is_resource).RunChecks())
62 results.extend(js_checker.JSChecker(input_api, output_api, 64 results.extend(js_checker.JSChecker(input_api, output_api,
63 file_filter=file_filter).RunChecks()) 65 file_filter=certain_dirs).RunChecks())
64 finally: 66 finally:
65 sys.path = old_path 67 sys.path = old_path
66 68
67 return results 69 return results
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698