Sort imports when interpolating sample templates (#81873)

This commit is contained in:
Greg Spencer
2021-05-07 15:34:04 -07:00
committed by GitHub
parent 9bca38c5e5
commit 59b406c760
3 changed files with 74 additions and 9 deletions

View File

@@ -613,16 +613,10 @@ dependencies:
''');
// Copy in the analysis options from the Flutter root.
// Import the analysis options from the Flutter root.
final File rootAnalysisOptions = File(path.join(_flutterRoot,'analysis_options.yaml'));
final File analysisOptions = File(path.join(directory.path, 'analysis_options.yaml'));
analysisOptions.writeAsStringSync('''
include: ${rootAnalysisOptions.absolute.path}
analyzer:
errors:
directives_ordering: ignore
''');
analysisOptions.writeAsStringSync('include: ${rootAnalysisOptions.absolute.path}');
}
/// Writes out a sample section to the disk and returns the file.