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.
The old 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 frozen_string_literal
,
Also, we could use certain tags directly. For instance, to find comments starting with TODO,
Rails 6
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 (FIXME
, OPTIMIZE
, TODO
),
And to find annotations with custom tags,
Note that the old rails notes:custom
, rails notes:fixme
, rails notes:todo
, rails notes:optimize
have been marked as deprecated.
Calling any notes command with rake
instead of rails
has also been deprecated.