Skip to content

Commit

Permalink
Resolve default annotation tags after config loads
Browse files Browse the repository at this point in the history
`Rails::SourceAnnotationExtractor::Annotation.tags` may be modified by
app configuration.  Therefore, resolve default annotation tags after
loading the app configuration.

This fixes errors like https://buildkite.com/rails/rails/builds/74268#240d60bc-baa7-4b6e-ad21-b3172095f939/1083-1092
resulting from rails/thor@0222fe5.
  • Loading branch information
jonathanhefner committed Jan 21, 2021
1 parent 166960c commit ad25006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions railties/lib/rails/commands/notes/notes_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Rails
module Command
class NotesCommand < Base # :nodoc:
class_option :annotations, aliases: "-a", desc: "Filter by specific annotations, e.g. Foobar TODO", type: :array, default: Rails::SourceAnnotationExtractor::Annotation.tags
class_option :annotations, aliases: "-a", desc: "Filter by specific annotations, e.g. Foobar TODO", type: :array

def perform(*)
require_application_and_environment!
Expand All @@ -15,7 +15,7 @@ def perform(*)

private
def display_annotations
annotations = options[:annotations]
annotations = options[:annotations] || Rails::SourceAnnotationExtractor::Annotation.tags
tag = (annotations.length > 1)

Rails::SourceAnnotationExtractor.enumerate annotations.join("|"), tag: tag, dirs: directories
Expand Down

0 comments on commit ad25006

Please sign in to comment.