OLD | NEW |
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 depot_tools, 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. |
11 """ | 11 """ |
12 | 12 |
13 # TODO(dbeam): Real CSS parser? https://github.com/danbeam/css-py/tree/css3 | 13 # TODO(dbeam): Real CSS parser? https://github.com/danbeam/css-py/tree/css3 |
14 | 14 |
15 class CSSChecker(object): | 15 class CSSChecker(object): |
16 def __init__(self, input_api, output_api, file_filter=None): | 16 def __init__(self, input_api, output_api, file_filter=None): |
17 self.input_api = input_api | 17 self.input_api = input_api |
18 self.output_api = output_api | 18 self.output_api = output_api |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 '%s:\n%s' % (f[0], '\n\n'.join(file_errors)))) | 383 '%s:\n%s' % (f[0], '\n\n'.join(file_errors)))) |
384 | 384 |
385 if results: | 385 if results: |
386 # Add your name if you're here often mucking around in the code. | 386 # Add your name if you're here often mucking around in the code. |
387 authors = ['dbeam@chromium.org'] | 387 authors = ['dbeam@chromium.org'] |
388 results.append(self.output_api.PresubmitNotifyResult( | 388 results.append(self.output_api.PresubmitNotifyResult( |
389 'Was the CSS checker useful? Send feedback or hate mail to %s.' % | 389 'Was the CSS checker useful? Send feedback or hate mail to %s.' % |
390 ', '.join(authors))) | 390 ', '.join(authors))) |
391 | 391 |
392 return results | 392 return results |
OLD | NEW |