What Is the Rails Notes Command?
While reading through the Rails 6 changelog, I noticed an entry for a rails command called notes. Having never seen this before, I took a quick look at the Rails Guides.
The command rails notes will return a list of all instances of the following annotations in your codebase - FIXME, OPTIMIZE, and TODO.
You can optionally search for your own custom annotations with the --annotations (-a) flag:
rails notes -a NOTE
app/controllers/admin/blog_posts_controller.rb:
* [10] [NOTE] Only return the last 10 blog posts
README.md:
* [ 1] [NOTE] Set the following env variables
There's also a way to register your own custom annotations for use with the default runner
config.annotations.register_tags("DEPRECATEME", "TESTME")
Tweet