OLD | NEW |
1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 /// Command line tool to write checker errors as inline comments in the source | 6 /// Command line tool to write checker errors as inline comments in the source |
7 /// code of the program. This tool requires the info.json file created by | 7 /// code of the program. This tool requires the info.json file created by |
8 /// running devc.dart passing the arguments | 8 /// running devc.dart passing the arguments |
9 /// --dump-info --dump-info-file info.json | 9 /// --dump-info --dump-info-file info.json |
10 | 10 |
11 library dev_compiler.bin.edit_files; | 11 library dev_compiler.bin.edit_files; |
12 | 12 |
13 import 'dart:io'; | 13 import 'dart:io'; |
14 import 'dart:convert'; | 14 import 'dart:convert'; |
15 | 15 |
16 import 'package:args/args.dart'; | 16 import 'package:args/args.dart'; |
17 import 'package:cli_util/cli_util.dart' show getSdkDir; | 17 import 'package:cli_util/cli_util.dart' show getSdkDir; |
18 import 'package:source_maps/refactor.dart'; | 18 import 'package:source_maps/refactor.dart'; |
19 import 'package:source_span/source_span.dart'; | 19 import 'package:source_span/source_span.dart'; |
20 | 20 |
21 import 'package:dev_compiler/src/options.dart'; | 21 import 'package:dev_compiler/src/options.dart'; |
22 import 'package:dev_compiler/src/report.dart'; | 22 import 'package:dev_compiler/src/summary.dart'; |
23 import 'package:dev_compiler/src/checker/resolver.dart' show TypeResolver; | 23 import 'package:dev_compiler/src/checker/resolver.dart' show TypeResolver; |
24 | 24 |
25 final ArgParser argParser = new ArgParser() | 25 final ArgParser argParser = new ArgParser() |
26 ..addOption('level', help: 'Minimum error level', defaultsTo: "info") | 26 ..addOption('level', help: 'Minimum error level', defaultsTo: "info") |
27 ..addOption('checkout-files-executable', | 27 ..addOption('checkout-files-executable', |
28 help: 'Executable to check out files from source control (e.g. svn)', | 28 help: 'Executable to check out files from source control (e.g. svn)', |
29 defaultsTo: null) | 29 defaultsTo: null) |
30 ..addOption('checkout-files-arg', | 30 ..addOption('checkout-files-arg', |
31 help: 'Arg to check out files from source control (e.g. checkout)', | 31 help: 'Arg to check out files from source control (e.g. checkout)', |
32 defaultsTo: null) | 32 defaultsTo: null) |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 var includePattern = (args['include-pattern'] != null) | 140 var includePattern = (args['include-pattern'] != null) |
141 ? new RegExp(args['include-pattern']) | 141 ? new RegExp(args['include-pattern']) |
142 : null; | 142 : null; |
143 | 143 |
144 var visitor = new EditFileSummaryVisitor(typeResolver, args['level'], | 144 var visitor = new EditFileSummaryVisitor(typeResolver, args['level'], |
145 args['checkout-files-executable'], args['checkout-files-arg'], | 145 args['checkout-files-executable'], args['checkout-files-arg'], |
146 includePattern, excludePattern); | 146 includePattern, excludePattern); |
147 summary.accept(visitor); | 147 summary.accept(visitor); |
148 visitor.build(); | 148 visitor.build(); |
149 } | 149 } |
OLD | NEW |