| 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 library analyzer.src.task.options; | 5 library analyzer.src.task.options; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/analyzer.dart'; | 9 import 'package:analyzer/analyzer.dart'; |
| 10 import 'package:analyzer/plugin/options.dart'; | 10 import 'package:analyzer/plugin/options.dart'; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 /// `analyzer` analysis options constants. | 43 /// `analyzer` analysis options constants. |
| 44 class AnalyzerOptions { | 44 class AnalyzerOptions { |
| 45 static const String analyzer = 'analyzer'; | 45 static const String analyzer = 'analyzer'; |
| 46 static const String enableAsync = 'enableAsync'; | 46 static const String enableAsync = 'enableAsync'; |
| 47 static const String enableGenericMethods = 'enableGenericMethods'; | 47 static const String enableGenericMethods = 'enableGenericMethods'; |
| 48 static const String enableStrictCallChecks = 'enableStrictCallChecks'; | 48 static const String enableStrictCallChecks = 'enableStrictCallChecks'; |
| 49 static const String enableSuperMixins = 'enableSuperMixins'; | 49 static const String enableSuperMixins = 'enableSuperMixins'; |
| 50 static const String enableTrailingCommas = 'enableTrailingCommas'; | 50 static const String enableTrailingCommas = 'enableTrailingCommas'; |
| 51 | 51 |
| 52 /// This option is deprecated. | |
| 53 static const String enableConditionalDirectives = | |
| 54 "enableConditionalDirectives"; | |
| 55 static const String errors = 'errors'; | 52 static const String errors = 'errors'; |
| 56 static const String exclude = 'exclude'; | 53 static const String exclude = 'exclude'; |
| 57 static const String language = 'language'; | 54 static const String language = 'language'; |
| 58 static const String plugins = 'plugins'; | 55 static const String plugins = 'plugins'; |
| 59 static const String strong_mode = 'strong-mode'; | 56 static const String strong_mode = 'strong-mode'; |
| 60 | 57 |
| 61 /// Ways to say `ignore`. | 58 /// Ways to say `ignore`. |
| 62 static const List<String> ignoreSynonyms = const ['ignore', 'false']; | 59 static const List<String> ignoreSynonyms = const ['ignore', 'false']; |
| 63 | 60 |
| 64 /// Valid error `severity`s. | 61 /// Valid error `severity`s. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 76 errors, | 73 errors, |
| 77 exclude, | 74 exclude, |
| 78 language, | 75 language, |
| 79 plugins, | 76 plugins, |
| 80 strong_mode | 77 strong_mode |
| 81 ]; | 78 ]; |
| 82 | 79 |
| 83 /// Supported `analyzer` language configuration options. | 80 /// Supported `analyzer` language configuration options. |
| 84 static const List<String> languageOptions = const [ | 81 static const List<String> languageOptions = const [ |
| 85 enableAsync, | 82 enableAsync, |
| 86 enableConditionalDirectives, | |
| 87 enableGenericMethods, | 83 enableGenericMethods, |
| 88 enableStrictCallChecks, | 84 enableStrictCallChecks, |
| 89 enableSuperMixins | 85 enableSuperMixins, |
| 86 enableTrailingCommas |
| 90 ]; | 87 ]; |
| 91 } | 88 } |
| 92 | 89 |
| 93 /// Validates `analyzer` options. | 90 /// Validates `analyzer` options. |
| 94 class AnalyzerOptionsValidator extends CompositeValidator { | 91 class AnalyzerOptionsValidator extends CompositeValidator { |
| 95 AnalyzerOptionsValidator() | 92 AnalyzerOptionsValidator() |
| 96 : super([ | 93 : super([ |
| 97 new TopLevelAnalyzerOptionsValidator(), | 94 new TopLevelAnalyzerOptionsValidator(), |
| 98 new StrongModeOptionValueValidator(), | 95 new StrongModeOptionValueValidator(), |
| 99 new ErrorFilterOptionValidator(), | 96 new ErrorFilterOptionValidator(), |
| (...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 String feature = key.value?.toString(); | 556 String feature = key.value?.toString(); |
| 560 _applyLanguageOption(options, feature, value.value); | 557 _applyLanguageOption(options, feature, value.value); |
| 561 } | 558 } |
| 562 }); | 559 }); |
| 563 } else if (configs is Map) { | 560 } else if (configs is Map) { |
| 564 configs | 561 configs |
| 565 .forEach((key, value) => _applyLanguageOption(options, key, value)); | 562 .forEach((key, value) => _applyLanguageOption(options, key, value)); |
| 566 } | 563 } |
| 567 } | 564 } |
| 568 } | 565 } |
| OLD | NEW |