Unverified Commit f8cafd9d authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Remove URLs in deprecation annotation (#45215)

parent 0e36a91d
...@@ -131,7 +131,7 @@ Future<void> run(List<String> arguments) async { ...@@ -131,7 +131,7 @@ Future<void> run(List<String> arguments) async {
final RegExp _findDeprecationPattern = RegExp(r'@[Dd]eprecated'); 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\($'); // ignore: flutter_deprecation_syntax (see analyze.dart)
final RegExp _deprecationPattern2 = RegExp(r"^ *'(.+) '$"); final RegExp _deprecationPattern2 = RegExp(r"^ *'(.+) '$");
final RegExp _deprecationPattern3 = RegExp(r"^ *'This feature was deprecated after v([0-9]+)\.([0-9]+)\.([0-9]+)\.(?: See: (https://flutter.dev/.+))?'$"); final RegExp _deprecationPattern3 = RegExp(r"^ *'This feature was deprecated after v([0-9]+)\.([0-9]+)\.([0-9]+)\.'$");
final RegExp _deprecationPattern4 = RegExp(r'^ *\)$'); final RegExp _deprecationPattern4 = RegExp(r'^ *\)$');
/// Some deprecation notices are special, for example they're used to annotate members that /// Some deprecation notices are special, for example they're used to annotate members that
...@@ -190,10 +190,6 @@ Future<void> verifyDeprecations(String workingDirectory) async { ...@@ -190,10 +190,6 @@ Future<void> verifyDeprecations(String workingDirectory) async {
throw 'Deprecation notice should be a grammatically correct sentence and end with a period.'; throw 'Deprecation notice should be a grammatically correct sentence and end with a period.';
if (!lines[lineNumber].startsWith("$indent '")) if (!lines[lineNumber].startsWith("$indent '"))
throw 'Unexpected deprecation notice indent.'; throw 'Unexpected deprecation notice indent.';
if (int.parse(match3[1]) > 1 || int.parse(match3[2]) > 11) {
if (match3[4] == null)
throw 'A URL to the deprecation notice is required.';
}
lineNumber += 1; lineNumber += 1;
if (lineNumber >= lines.length) if (lineNumber >= lines.length)
throw 'Incomplete deprecation notice.'; throw 'Incomplete deprecation notice.';
......
...@@ -52,3 +52,9 @@ void test8() { } ...@@ -52,3 +52,9 @@ void test8() { }
'This feature was deprecated after v1.2.3.' 'This feature was deprecated after v1.2.3.'
) )
void test10() { } void test10() { }
@Deprecated(
'URLs are not required. '
'This feature was deprecated after v2.0.0.'
)
void test11() { }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment