Shopify/smart_todo

"TODO(username):" pattern

burke opened this issue · 3 comments

burke commented

Was talking through this the other day with the rest of the team. It sounds like smart_todo will try to interpret all TODO(*) comments, and this would conflict with the common "TODO(me):" pattern.

If that's correct, I think this is kind of unreasonable, but I don't have a suggestion for how this could be handled differently.

Anyway, here's a place for discussion about this conflict.

👋 Thanks for opening the issue!

It sounds like smart_todo will try to interpret all TODO(*) comments

yeah that's correct it will try to parse all comment that starts with TODO(.
However, if the syntax inside the TODO() is not the one expected, it won't do anything.

Does writing TODO(me) creates a problem? It shouldn't

burke commented

Nope that sounds great then, I just opened this without trying, but it does raise the opposite case... what if the user meant for a todo to be a smart todo but typo’d something? Will it silently not work? Sorry, I’ll just read the code.

meant for a todo to be a smart todo but typo’d something? Will it silently not work?

Yes indeed it will silently fail. Though, if an app uses rubocop and activated the smart_todo_cop, malformated Smart Todo will be reported https://github.com/Shopify/smart_todo/wiki/Restrict-regular-TODO