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

Side by Side Diff: runtime/PRESUBMIT.py

Issue 2451613005: Format GN files and add a presubmit check that GN is properly formatted (Closed)
Patch Set: Fix gn args 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/BUILD.gn ('k') | runtime/bin/BUILD.gn » ('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 26 matching lines...) Expand all
37 cpplint.ProcessFile(filename, 1) 37 cpplint.ProcessFile(filename, 1)
38 # Check for memcpy use. 38 # Check for memcpy use.
39 memcpy_match_count += CheckMemcpy(filename) 39 memcpy_match_count += CheckMemcpy(filename)
40 40
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):
48 return input_api.canned_checks.CheckGNFormatted(input_api, output_api)
49
50
47 def CheckChangeOnUpload(input_api, output_api): 51 def CheckChangeOnUpload(input_api, output_api):
48 return RunLint(input_api, output_api) 52 return (RunLint(input_api, output_api) +
53 CheckGn(input_api, output_api))
49 54
50 55
51 def CheckChangeOnCommit(input_api, output_api): 56 def CheckChangeOnCommit(input_api, output_api):
52 return RunLint(input_api, output_api) 57 return (RunLint(input_api, output_api) +
58 CheckGn(input_api, output_api))
OLDNEW
« no previous file with comments | « runtime/BUILD.gn ('k') | runtime/bin/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698