[Analyze] Make deprecation note analyzer clearer on quote misuse (#77653)
* Impl
* Escape$
* eofnl
* Make message more clear
diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart
index b31f040..aeef8fc 100644
--- a/dev/bots/analyze.dart
+++ b/dev/bots/analyze.dart
@@ -171,8 +171,13 @@
String message;
do {
final Match match2 = _deprecationPattern2.firstMatch(lines[lineNumber]);
- if (match2 == null)
- throw 'Deprecation notice does not match required pattern.';
+ if (match2 == null) {
+ String possibleReason = '';
+ if (lines[lineNumber].trimLeft().startsWith('"')) {
+ possibleReason = ' You might have used double quotes (") for the string instead of single quotes (\').';
+ }
+ throw 'Deprecation notice does not match required pattern.$possibleReason';
+ }
if (!lines[lineNumber].startsWith("$indent '"))
throw 'Unexpected deprecation notice indent.';
if (message == null) {