Page MenuHomePhabricator

Index "TODO" comments and other references present in source code
Open, Needs TriagePublic

Description

Often we will comment our code as follows:

// TODO: This is gross and should be refactored after T123.
perform_some_ugly_hack();

Usually in this case, we will just comment on T123 with "we added some ugly hack to the SomeClass class, we should fix that later" but it would be nice if this happened automatically, like "alincoln mentioned this task in $COMMIT". This would probably be difficult, but I personally would find it to be valuable.

Event Timeline

joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence updated the task description. (Show Details)
joshuaspence added a subscriber: joshuaspence.

Another (not necessarily good) attack on this would be to extract these with a linter (similar to the TODO linter), and then maybe, uh, let lint messages have an object PHID on them? I guess? This feels real sketchy but maybe there are some other reasonable things we could do which could justify it.

The lint + Diffusion integration doesn't work nearly as well as most of Phabricator today, but I anticipate it getting better as Harbormaster/Drydock move forward, similar to how symbols are coming out of the dark ages.

Tracking moves and fixes of these things seems like the hard part: it would maybe be nicer to see "all places in the codebase a task is currently mentioned", not necessarily "all places a task has ever been mentioned". But maybe this isn't actually that important.

I'm also not sure how important the state changes are ("a mention in file X on line Y was removed"). They seem nice but really hard to get right, since "move" vs "add + remove" is usually at least somewhat ambiguous.

epriestley renamed this task from Allow mentions in commit contents to Index "TODO" comments and other references present in source code.Apr 22 2019, 6:06 PM