nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.94k stars 639 forks source link

Feature Request: Accept a wider range of "TODO"/"FIXME" tokens #630

Open dalemyers opened 4 years ago

dalemyers commented 4 years ago

Currently the todos rule matches on some keywords in comments to verify formatting. However, a common standard in larger codebases is something like:

// TODO[steve]: Do the thing

or

// TODO(someone@example.com): Do different thing

Since these don't tokenize to "TODO", the rule doesn't pick them up, letting them slip through. I can't think of any case where // TODO: [steve] Do the thing wouldn't be acceptable, so my suggestion would be to expand the tokenization here to check for TODO( or TODO[ to help mitigate this.

nicklockwood commented 4 years ago

Good idea 👍