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

Unified Diff: pkg/analyzer/lib/source/analysis_options_provider.dart

Issue 1975963002: Support the name analysis_options.yaml for analysis options files (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/lib/source/analysis_options_provider.dart
diff --git a/pkg/analyzer/lib/source/analysis_options_provider.dart b/pkg/analyzer/lib/source/analysis_options_provider.dart
index 3b6e33075634fb692c890f5a729414570971bd48..2acab1dd71f289046acab6aa166f7fb45b06ddc6 100644
--- a/pkg/analyzer/lib/source/analysis_options_provider.dart
+++ b/pkg/analyzer/lib/source/analysis_options_provider.dart
@@ -12,14 +12,19 @@ import 'package:analyzer/src/util/yaml.dart';
import 'package:source_span/source_span.dart';
import 'package:yaml/yaml.dart';
-/// Provide the options found in the `.analysis_options` file.
+/// Provide the options found in the analysis options file.
class AnalysisOptionsProvider {
- /// Provide the options found in [root]/[ANALYSIS_OPTIONS_FILE].
+ /// Provide the options found in either [root]/[ANALYSIS_OPTIONS_FILE] or
+ /// [root]/[ANALYSIS_OPTIONS_YAML_FILE].
/// Return an empty options map if the file does not exist.
Map<String, YamlNode> getOptions(Folder root, {bool crawlUp: false}) {
Resource resource;
for (Folder folder = root; folder != null; folder = folder.parent) {
resource = folder.getChild(AnalysisEngine.ANALYSIS_OPTIONS_FILE);
+ if (resource.exists) {
+ break;
+ }
+ resource = folder.getChild(AnalysisEngine.ANALYSIS_OPTIONS_YAML_FILE);
if (resource.exists || !crawlUp) {
break;
}

Powered by Google App Engine
This is Rietveld 408576698