rails notes is used to search your code in a Rails application to find comments beginning with specific keywords.
Rails 6 adds
Rails::Command::NotesCommand to follow the pattern for
Rails::Commands. It also introduces some useful changes to the
rails notes API.
rake notes usage has been modified
to call that newer command under the hood
with a deprecation warning when called with the old API.
Before Rails 6
Previously, one had to use environment variable to find comments beginning with custom keywords.
For instance, to find comments starting with
Also, we could use certain tags directly. For instance, to find comments starting with TODO,
With Rails 6, we can seamlessly use
--annotations argument to either search for default tags or pass specific annotation(s).
For instance, to find comments beginning with default tags (
And to find annotations with custom tags,
Note that the old
rails notes:optimize have been marked as deprecated.
Calling any notes command with
rake instead of
rails has also been deprecated.