Skip to content

Use word regexp to find TODO/FIXME/HACK/XXX items.

I noticed when checking out the gnome-calendar repo in the nightly Builder flatpak that the symbol GCAL_TODO appeared in the TODO/FIXME panel.

To fix that, we could use word regexp in the grep command of the todo plugin (src/plugins/todo/gbp-todo-model.c#gbp_todo_model_mine_worker). From the grep man page:

-w, --word-regexp
              Select only those lines containing matches that form whole words.  The test is that  the  matching  substring
              must  either be at the beginning of the line, or preceded by a non-word constituent character.  Similarly, it
              must be either at the end of the line or followed by  a  non-word  constituent  character.   Word-constituent
              characters are letters, digits, and the underscore.  This option has no effect if -x is also specified.

This prevents the creation of certain TODO items that are actually part of the codebase, e.g. symbols like GCAL_TODO in gnome-calendar. It won't do much if a symbol is named TODO though. Perhaps a future enhancement? could filter for TODO items that are in comments only?

This PR also:

  • Adds the _build directory to the list of excluded directories to search in since many GNOME projects use that as the build directory name.
  • Fixes a minor spelling error.

Merge request reports