Skip to content
Andrew Kerr edited this page Nov 20, 2021 · 10 revisions

Summary

SmartTodo is a gem designed to enhance regular TODO comments in your codebase.

There are a multitude of reasons to write TODO comments in your code and it's a good practice. The problem is that they tend to become stale and can be easily forgotten by their original authors. Furthermore, if the original author leaves your organization, there is a high chance that the TODO they wrote will remain in your codebase for longer than it should.


Example

Here is a concrete example of how SmartTodo can help you:

module MyMonkeyPatch
  def foo
    puts 'hello'
  end
end

# Without SmartTodo
#
# TODO: Library has a bug in version 2.3, we proposed a fix upstream but are waiting for the maintainer to accept it. We can remove this monkey patch when https://github.com/johncena/library/pulls/32 is merged.
#
# With SmartTodo
#
# TODO(on: pull_request_close('johncena', 'library', 32), to: '[email protected]')
#   Library has a bug in version 2.3, we proposed a fix
#   upstream but are waiting for the maintainer to accept it.
Library::ImportantClass.prepend(MonkeyPatch)

When the Pull Request #32 is merged, SmartTodo will send a Slack message to the assigned user, letting them know the TODO is ready to be addressed. If for some reasons, the TODO assignee is no longer part of your organisation, the Slack message will be sent to a fallback channel of your choice (configurable with the command line)

Screenshot 2019-07-19 at 02 14 51

Head to the Syntax page to learn how to write a SmartTodo.

Clone this wiki locally