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

Side by Side Diff: runtime/PRESUBMIT.py

Issue 2483363002: clang-formats remaining files and adds a presubmit check. (Closed)
Patch Set: Format include file Created 4 years, 1 month 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
« no previous file with comments | « runtime/CPPLINT.cfg ('k') | runtime/bin/loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 import os 5 import os
6 import cpplint 6 import cpplint
7 import re 7 import re
8 8
9 # memcpy does not handle overlapping memory regions. Even though this 9 # memcpy does not handle overlapping memory regions. Even though this
10 # is well documented it seems to be used in error quite often. To avoid 10 # is well documented it seems to be used in error quite often. To avoid
(...skipping 30 matching lines...) Expand all
41 # Report a presubmit error if any of the files had an error. 41 # Report a presubmit error if any of the files had an error.
42 if cpplint._cpplint_state.error_count > 0 or memcpy_match_count > 0: 42 if cpplint._cpplint_state.error_count > 0 or memcpy_match_count > 0:
43 result = [output_api.PresubmitError('Failed cpplint check.')] 43 result = [output_api.PresubmitError('Failed cpplint check.')]
44 return result 44 return result
45 45
46 46
47 def CheckGn(input_api, output_api): 47 def CheckGn(input_api, output_api):
48 return input_api.canned_checks.CheckGNFormatted(input_api, output_api) 48 return input_api.canned_checks.CheckGNFormatted(input_api, output_api)
49 49
50 50
51 def CheckFormatted(input_api, output_api):
52 return input_api.canned_checks.CheckPatchFormatted(input_api, output_api)
53
54
51 def CheckChangeOnUpload(input_api, output_api): 55 def CheckChangeOnUpload(input_api, output_api):
52 return (RunLint(input_api, output_api) + 56 return (RunLint(input_api, output_api) +
53 CheckGn(input_api, output_api)) 57 CheckGn(input_api, output_api) +
58 CheckFormatted(input_api, output_api))
54 59
55 60
56 def CheckChangeOnCommit(input_api, output_api): 61 def CheckChangeOnCommit(input_api, output_api):
57 return (RunLint(input_api, output_api) + 62 return (RunLint(input_api, output_api) +
58 CheckGn(input_api, output_api)) 63 CheckGn(input_api, output_api) +
64 CheckFormatted(input_api, output_api))
OLDNEW
« no previous file with comments | « runtime/CPPLINT.cfg ('k') | runtime/bin/loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698