Migrate out custom ignore syntax to flutter_ignore (#78497)
This commit is contained in:
committed by
GitHub
parent
a7e3b1a35d
commit
197b440e96
@@ -126,7 +126,7 @@ Future<void> run(List<String> arguments) async {
|
||||
// TESTS
|
||||
|
||||
final RegExp _findDeprecationPattern = RegExp(r'@[Dd]eprecated');
|
||||
final RegExp _deprecationPattern1 = RegExp(r'^( *)@Deprecated\($'); // ignore: flutter_deprecation_syntax (see analyze.dart)
|
||||
final RegExp _deprecationPattern1 = RegExp(r'^( *)@Deprecated\($'); // flutter_ignore: deprecation_syntax (see analyze.dart)
|
||||
final RegExp _deprecationPattern2 = RegExp(r"^ *'(.+) '$");
|
||||
final RegExp _deprecationPattern3 = RegExp(r"^ *'This feature was deprecated after v([0-9]+)\.([0-9]+)\.([0-9]+)(\-[0-9]+\.[0-9]+\.pre)?\.'$");
|
||||
final RegExp _deprecationPattern4 = RegExp(r'^ *\)$');
|
||||
@@ -136,10 +136,10 @@ final RegExp _deprecationPattern4 = RegExp(r'^ *\)$');
|
||||
/// (One example would be a library that intentionally conflicts with a member in another
|
||||
/// library to indicate that it is incompatible with that other library. Another would be
|
||||
/// the regexp just above...)
|
||||
const String _ignoreDeprecation = ' // ignore: flutter_deprecation_syntax (see analyze.dart)';
|
||||
const String _ignoreDeprecation = ' // flutter_ignore: deprecation_syntax (see analyze.dart)';
|
||||
|
||||
/// Some deprecation notices are exempt for historical reasons. They must have an issue listed.
|
||||
final RegExp _legacyDeprecation = RegExp(r' // ignore: flutter_deprecation_syntax, https://github.com/flutter/flutter/issues/[0-9]+$');
|
||||
final RegExp _legacyDeprecation = RegExp(r' // flutter_ignore: deprecation_syntax, https://github.com/flutter/flutter/issues/[0-9]+$');
|
||||
|
||||
Future<void> verifyDeprecations(String workingDirectory, { int minimumMatches = 2000 }) async {
|
||||
final List<String> errors = <String>[];
|
||||
|
||||
@@ -26,7 +26,7 @@ final RegExp ignoreForFilePattern = RegExp(r'// *ignore_for_file:');
|
||||
final RegExp asDynamicPattern = RegExp(r'\bas dynamic\b');
|
||||
final RegExp deprecationPattern = RegExp(r'^ *@[dD]eprecated');
|
||||
const Pattern globalsPattern = 'globals.';
|
||||
const String legacyDeprecationPattern = '// ignore: flutter_deprecation_syntax, https';
|
||||
const String legacyDeprecationPattern = '// flutter_ignore: deprecation_syntax, https';
|
||||
|
||||
Future<double> findCostsForFile(File file) async {
|
||||
if (path.extension(file.path) == '.py')
|
||||
|
||||
Reference in New Issue
Block a user