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

Side by Side Diff: pkg/analyzer/lib/src/task/options.dart

Issue 2129033003: Options validation cleanup. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 months 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 | « no previous file | no next file » | 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) 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
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698