-1
Declined

Notify when TODO items are found in code

woltman 8 years ago updated by Thomas Singer 5 years ago 6

I'd like for a notification to pop up when committing code that has TODO comments in it. IntelliJ's git plug-in does this. It looks through all the code you're about to commit and if it sees any TODO comments, it says something like "You've got outstanding TODO items, are you sure you want to commit this code?" and it lists the file name, line number, and the contents of the TODO note.


The feature can be disabled if it bothers the user, but I really like having it as a reminder.

Tracking business / code logic seems far outside the purview of version control and management. Suggesting a user not commit a section of code because it's in progress seems even more questionable, even counter-productive. Such a feature makes far more sense for a continuous integration system (or in IntelliJ's case, an IDE).


I could potentially see this making sense as a feature when creating pull requests, since those usually indicate a final product, but even that would be altering basic functionality based on assumptions.

That's a good point. The IDE I'm using nowadays isn't as sophisticated as IntelliJ (or other JetBrains' products). That's actually why I bought SmartGit, because it provides the git features that the IDE lacks.

+2

TODO means I want to do it later, so why bother notifying me right now?


I do see some point when you want some features from IDE, but please, don't enable those by default. I don't want a comment in the code to change my workflow.

I think that TODO comments might be used in many different ways by different people.  A notification would help me, because I generally don't want to check in code with unfinished TODO items.  For many people, I think having it off by default is a good idea.  Perhaps it could be a a notification with a checkbox for "Don't show me this again" option.

+1

This would be classical use case for a pre-commit hooks, easy if you just want to check the staged files, a bit more complicated if you just want to check the changed lines.