diff options
Diffstat (limited to 'railties/lib/rails/tasks/annotations.rake')
-rw-r--r-- | railties/lib/rails/tasks/annotations.rake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/railties/lib/rails/tasks/annotations.rake b/railties/lib/rails/tasks/annotations.rake new file mode 100644 index 0000000000..93bc66e2db --- /dev/null +++ b/railties/lib/rails/tasks/annotations.rake @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require "rails/source_annotation_extractor" + +desc "Enumerate all annotations (use notes:optimize, :fixme, :todo for focus)" +task :notes do + SourceAnnotationExtractor.enumerate "OPTIMIZE|FIXME|TODO", tag: true +end + +namespace :notes do + ["OPTIMIZE", "FIXME", "TODO"].each do |annotation| + # desc "Enumerate all #{annotation} annotations" + task annotation.downcase.intern do + SourceAnnotationExtractor.enumerate annotation + end + end + + desc "Enumerate a custom annotation, specify with ANNOTATION=CUSTOM" + task :custom do + SourceAnnotationExtractor.enumerate ENV["ANNOTATION"] + end +end |