Skip to content

Commit

Permalink
Turn off directives_ordering lint when analyzing samples (flutter#81698)
Browse files Browse the repository at this point in the history
This turns off the "directives_ordering" lint when analyzing samples, since it's indeterminate what the ordering will be, given that samples derive their imports both from the template and the example code.

This is temporary to avoid broken builds, but the correct solution is to reorder the output so that the imports are ordered properly so that we give the proper example for our users.
  • Loading branch information
gspencergoog committed May 3, 2021
1 parent 89d26d8 commit ea9d9ee
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dev/bots/analyze_sample_code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,17 @@ dependencies:
sdk: flutter
''');


// Copy in the analysis options from the Flutter root.
File(path.join(_flutterRoot,'analysis_options.yaml')).copySync(path.join(directory.path, 'analysis_options.yaml'));
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
''');
}

/// Writes out a sample section to the disk and returns the file.
Expand Down

0 comments on commit ea9d9ee

Please sign in to comment.