realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.6k stars 2.22k forks source link

Rule Request: Properly formatted TODO comments #2631

Open sindresorhus opened 5 years ago

sindresorhus commented 5 years ago

New Issue Checklist

New rule request

I would like to ensure TODO comments are formatted properly.

It should also apply to FIXME comments. It could be useful for MARK comments to, but then the rule needs a more generic name I think.

  1. Why should this rule be added? Share links to existing discussion about what the community thinks about this.

It's important to format TODOs correctly for readability and for Xcode to parse it correctly.

  1. Provide several examples of what would and wouldn't trigger violations.
  1. Should the rule be configurable, if so what parameters should be configurable?

You should be able to opt into only allowing // for TODO comments.

  1. Should the rule be opt-in or enabled by default? Why? See README.md for guidelines on when to mark a rule as opt-in.

Enabled by default. I can't imagine anyone wanting //TODO:Something.

marcelofabri commented 5 years ago

PS: we already have a rule for MARK

iliaskarim commented 4 years ago

@marcelofabri Should markrule be expanded to also account for todo's and renamed? That seems to make more sense than having a todorule, markrule, and todoformatting rule, for instance.

marcelofabri commented 4 years ago

I personally think that having another rule is easier for users as it gives them more choices (which rule to enable/disable, allow them to disable locally, etc)