7 ms·
I always suggest TODO's to be replaced during a Code Review by: 1. A ticket number that will be picked up shortly if should still be part of a larger change. I
by snorberhuis 5y ago
I always suggest TODO's to be replaced during a Code Review by:
1. A ticket number that will be picked up shortly if should still be part of a larger change. In a healthy team, this is done within two weeks and you know where to perform changes when you pick it up.
2. You do not add a TODO, but explain your current understanding of what is wrong and what should be done. This way you can refresh the knowledge if it ever again is touched. With a simple TODO, this knowledge is usually not writtend down.
- stevenhuang 5y agoOr do both. Might as well add TODO: to make it stand out as a thing that can be improved while also making it greppable.
- mihi 5y agoMight also be cool to automatically create these tickets (when commited to master?). Then you don't forget, and even if they end up not that detailed, you at least get a nice list of all of them.
- actinium226 5y agoTODO: Automatically create tickets based on TODO comments. We'll get to it. Someday.
- nrub 5y agoOne option if you're on github, https://github.com/marketplace/actions/todo-to-issue https://github.com/marketplace/actions/todo-to-issue
- mihi 5y agoThat is really cool! Thanks for mentioning.
- efnx 5y agoIf you want a cli tool for this I have one here https://github.com/Schell/todo_finder https://github.com/Schell/todo_finder You can output to markdown or to GitHub issues with a token. I used to operate a service that did this for you.
- jgwil2 5y agoI like this idea, but I would add that my preference for scenario 2 is to add HACK (or FIXME) along with the explanation instead. This way it is still searchable, but you make it a bit more clear that there is no obvious fix at the moment.
- hinkley 5y agoI don't think I can agree with this, since some TODOs have a different target audience. The kind of TODO you're talking about is splitting a ticket into parts so you can hit an artificial deadline (ie, it's no longer 'done done', it's just 'done'). If the artificial deadline is your boss, then we're in a bad place. If it's another team needing a feature, that's pipelining and that's often okay. For the TODOs that make it to PR without human error, I write most of them for the next person who adds functionality to an area, to either encourage them to do so or at least not make things worse. But sometimes it's for the person who hits the Rule of 3. Those TODO's should be addressed in six months, not two weeks, and having someone call me on them in a PR is not particularly helpful. No, I'm not going to quadruple the scope of this story because you don't like the word TODO.