aboutsummaryrefslogblamecommitdiffstats
path: root/railties/lib/rails/tasks/annotations.rake
blob: 3a78de418a7b74612dfea9dbd484a576dccc3585 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                             
                                           
 
                           

                                                                             


                   
                                                    
                                                      

                                                                                 
       

     
                              

                                                                               
     
   
# frozen_string_literal: true

require "rails/source_annotation_extractor"

task notes: :environment do
  Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning
  Rails::Command.invoke :notes
end

namespace :notes do
  ["OPTIMIZE", "FIXME", "TODO"].each do |annotation|
    task annotation.downcase.intern => :environment do
      Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning
      Rails::Command.invoke :notes, ["--annotations", annotation]
    end
  end

  task custom: :environment do
    Rails::SourceAnnotationExtractor::Annotation.notes_task_deprecation_warning
    Rails::Command.invoke :notes, ["--annotations", ENV["ANNOTATION"]]
  end
end