[flutter_style_todos] Only allow blank characters before `TODO`
Description
The flutter_style_todos rule is used to allow any single character before TODO, this PR disallows it.
Fixes #3919
Coverage remained the same at 95.636% when pulling d1beef52254a5eee77f0ced602544aac6b8c7f1e on AlexV525:improve-flutter-style-todos into 104a1977728b8d6e98da5360ba09312018f5a542 on dart-lang:main.
/fyi @a14n @goderbauer
The description here was confusing to me. It's technically correct in that this PR changes (restricts) the definition of what is considered a TODO, and therefore what can trigger being an invalid TODO.
Maybe it's the word "disallows" that throws me off, because the change allows (removes a lint warning from) a line like:
// Not a TODO.
Is the following description a correct interpretation of the change?
Changes what counts as a TODO to include fewer occurrences of "todo".
Previously anything of the form
//<anything> TODO(any casing) would count as a TODO, and could then be considered a malformed TODO by the lint. With the change, only two or more/s, followed by zero or one whitespace, and the "TODO" letters will be considered as a TODO, and other occurrences of "//" followed by "TODO" will not trigger the lint. That allows code like/// if (test) log(Severity.low, ToDo("Warning"));(fx as part of a DartDoc code sample) to not be linted against.
Maybe it's the word "disallows" that throws me off, because the change allows (removes a lint warning from) a line like:
@lrhn The request was long ago. If I understand correctly I'm trying to say that pattern will not be recognized as TODOs. Does that sound good to you?
Ack, I accidentally fell over this CL and didn't notice how old the request was. But yes, the charge is to not recognize some lines as being intended as todos, which were previously considered (possibly invalid) todos. It restricts the lines that are considered todos.
I'd probably reboot this in recent weeks. The reason why I didn't work on it anymore is I didn't receive responses.