| OLD | NEW |
| 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2012, 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 """Top-level presubmit script for Dart. | 5 """Top-level presubmit script for Dart. |
| 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. | 8 for more details about the presubmit API built into gcl. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 if old_version_has_errors: | 85 if old_version_has_errors: |
| 86 print("WARNING: %s has existing and possibly new dartfmt issues" % | 86 print("WARNING: %s has existing and possibly new dartfmt issues" % |
| 87 git_file.LocalPath()) | 87 git_file.LocalPath()) |
| 88 else: | 88 else: |
| 89 unformatted_files.append(filename) | 89 unformatted_files.append(filename) |
| 90 | 90 |
| 91 if unformatted_files: | 91 if unformatted_files: |
| 92 return [output_api.PresubmitError( | 92 return [output_api.PresubmitError( |
| 93 'File output does not match dartfmt.\n' | 93 'File output does not match dartfmt.\n' |
| 94 'Fix these issues with:\n' | 94 'Fix these issues with:\n' |
| 95 'dartfmt -w \\\n%s' % ' \\\n'.join(unformatted_files))] | 95 '%s -w \\\n%s' % (prebuilt_dartfmt, ' \\\n'.join(unformatted_files)))] |
| 96 | 96 |
| 97 return [] | 97 return [] |
| 98 | 98 |
| 99 def CheckChangeOnCommit(input_api, output_api): | 99 def CheckChangeOnCommit(input_api, output_api): |
| 100 return (_CheckBuildStatus(input_api, output_api) + | 100 return (_CheckBuildStatus(input_api, output_api) + |
| 101 _CheckDartFormat(input_api, output_api)) | 101 _CheckDartFormat(input_api, output_api)) |
| 102 | 102 |
| 103 def CheckChangeOnUpload(input_api, output_api): | 103 def CheckChangeOnUpload(input_api, output_api): |
| 104 return _CheckDartFormat(input_api, output_api) | 104 return _CheckDartFormat(input_api, output_api) |
| OLD | NEW |