From ea74e0768929816943f5ebc633164ede4c0b7fb1 Mon Sep 17 00:00:00 2001 From: Dan Rubel Date: Mon, 13 Feb 2017 16:39:35 -0500 Subject: [PATCH] move flutter user analysis options file (#8091) * move flutter user analysis options file * add comments referencing each of the analysis options files --- .analysis_options | 7 ++++++- .analysis_options_repo | 5 +++++ .../flutter/lib/analysis_options_user.yaml | 9 +++++++-- .../flutter_tools/lib/src/commands/analyze_once.dart | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) rename .analysis_options_user => packages/flutter/lib/analysis_options_user.yaml (88%) diff --git a/.analysis_options b/.analysis_options index 0f0e7a81f4..cd78af0737 100644 --- a/.analysis_options +++ b/.analysis_options @@ -7,8 +7,13 @@ # See the configuration guide for more # https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer # +# There are three similar analysis options files in the flutter repo: +# - .analysis_options (this file) +# - .analysis_options_repo +# - packages/flutter/lib/analysis_options_user.yaml +# # This file contains the analysis options used by Flutter editors, such as Atom. -# It is very similar to .analysis_options_flutter_analyze; +# It is very similar to the .analysis_options_repo file in this same directory; # the only difference (currently) is the public_member_api_docs option, # which triggers too many messages to be used in editors. diff --git a/.analysis_options_repo b/.analysis_options_repo index 0062353c01..79ea0660b3 100644 --- a/.analysis_options_repo +++ b/.analysis_options_repo @@ -7,6 +7,11 @@ # See the configuration guide for more # https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer # +# There are three similar analysis options files in the flutter repo: +# - .analysis_options +# - .analysis_options_repo (this file) +# - packages/flutter/lib/analysis_options_user.yaml +# # This file contains the analysis options used by 'flutter analyze' when analyzing # the flutter repository. It is very similar to .analysis_options; # the only difference (currently) is the public_member_api_docs option, diff --git a/.analysis_options_user b/packages/flutter/lib/analysis_options_user.yaml similarity index 88% rename from .analysis_options_user rename to packages/flutter/lib/analysis_options_user.yaml index c181462e6b..639046f079 100644 --- a/.analysis_options_user +++ b/packages/flutter/lib/analysis_options_user.yaml @@ -7,9 +7,14 @@ # See the configuration guide for more # https://github.com/dart-lang/sdk/tree/master/pkg/analyzer#configuring-the-analyzer # +# There are three similar analysis options files in the flutter repo: +# - .analysis_options +# - .analysis_options_repo +# - packages/flutter/lib/analysis_options_user.yaml (this file) +# # This file contains the analysis options used by "flutter analyze" -# when analyzing code outside the flutter repository. -# It isn't named '.analysis_options' because otherwise editors like Atom +# and the dartanalyzer when analyzing code outside the flutter repository. +# It isn't named 'analysis_options.yaml' because otherwise editors like Atom # would use it when analyzing the flutter tool itself. # # When editing, make sure you keep /.analysis_options consistent. diff --git a/packages/flutter_tools/lib/src/commands/analyze_once.dart b/packages/flutter_tools/lib/src/commands/analyze_once.dart index c4ae08ba23..846156cc7b 100644 --- a/packages/flutter_tools/lib/src/commands/analyze_once.dart +++ b/packages/flutter_tools/lib/src/commands/analyze_once.dart @@ -148,7 +148,7 @@ class AnalyzeOnce extends AnalyzeBase { options.packageMap = packages; options.analysisOptionsFile = flutterRepo ? path.join(Cache.flutterRoot, '.analysis_options_repo') - : path.join(Cache.flutterRoot, '.analysis_options_user'); + : path.join(Cache.flutterRoot, 'packages', 'flutter', 'lib', 'analysis_options_user.yaml'); AnalysisDriver analyzer = new AnalysisDriver(options); // TODO(pq): consider error handling