OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Support for client code that wants to consume options contributed to the | 5 /// Support for client code that wants to consume options contributed to the |
6 /// analysis options file. | 6 /// analysis options file. |
7 library analyzer.plugin.options; | 7 library analyzer.plugin.options; |
8 | 8 |
9 import 'package:analyzer/error/listener.dart'; | 9 import 'package:analyzer/error/listener.dart'; |
10 import 'package:yaml/yaml.dart'; | 10 import 'package:yaml/yaml.dart'; |
11 | 11 |
12 /// Validates options as defined in an analysis options file. | 12 /// Validates options as defined in an analysis options file. |
13 /// | 13 /// |
14 /// The options file format is intentionally very open-ended, giving clients | 14 /// The options file format is intentionally very open-ended, giving clients |
15 /// utmost flexibility in defining their own options. The only hardfast | 15 /// utmost flexibility in defining their own options. The only hard and fast |
16 /// expectation is that options files will contain a mapping from Strings | 16 /// expectation is that options files will contain a mapping from Strings |
17 /// (identifying 'scopes') to associated options. For example, the given | 17 /// (identifying 'scopes') to associated options. For example, the given |
18 /// content | 18 /// content |
19 /// | 19 /// |
20 /// linter: | 20 /// linter: |
21 /// rules: | 21 /// rules: |
22 /// camel_case_types: true | 22 /// camel_case_types: true |
23 /// compiler: | 23 /// compiler: |
24 /// resolver: | 24 /// resolver: |
25 /// useMultiPackage: true | 25 /// useMultiPackage: true |
(...skipping 10 matching lines...) Expand all Loading... |
36 /// | 36 /// |
37 /// bool useMultiPackage = | 37 /// bool useMultiPackage = |
38 /// options['compiler']['resolver']['useMultiPackage']; | 38 /// options['compiler']['resolver']['useMultiPackage']; |
39 /// | 39 /// |
40 /// Clients may implement this class when implementing plugins. | 40 /// Clients may implement this class when implementing plugins. |
41 /// | 41 /// |
42 abstract class OptionsValidator { | 42 abstract class OptionsValidator { |
43 /// Validate [options], reporting any errors to the given [reporter]. | 43 /// Validate [options], reporting any errors to the given [reporter]. |
44 void validate(ErrorReporter reporter, Map<String, YamlNode> options); | 44 void validate(ErrorReporter reporter, Map<String, YamlNode> options); |
45 } | 45 } |
OLD | NEW |