zulip-flutter
zulip-flutter copied to clipboard
test: If a new commit on the current branch has a `Fixes: #…` line, check codebase for `TODO(#…)`s
It would be nice to have an automated check for TODO(#…)s that remain in the code when they're supposed to be deleted as part of fixing the specified issue. These might have been left in accidentally despite the issue actually being fixed properly, or they might have been missed because there was actually something important to do that wasn't done.
Can we add something in tools/check that checks all new commits on the current branch (the ones not on upstream/main) to see if any has a Fixes line, and errors if there are any corresponding TODO(#…)s still in the codebase?
Sure, seems reasonable.
The way to spell upstream/main in the script should be $(git_upstream_ref), using a helper from lib/git.sh.
Then to find "Fixes" lines, I'd take git log "$(git_upstream_ref)".. --format=%b and pipe that through an appropriate Perl one-liner, which can print just the issue number for each match.