diff --git a/lib/i18n/tasks/scanners/ast_matchers/default_i18n_subject_matcher.rb b/lib/i18n/tasks/scanners/ast_matchers/default_i18n_subject_matcher.rb index a198a0e3..923fc24a 100644 --- a/lib/i18n/tasks/scanners/ast_matchers/default_i18n_subject_matcher.rb +++ b/lib/i18n/tasks/scanners/ast_matchers/default_i18n_subject_matcher.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'i18n/tasks/scanners/ast_matchers/base_matcher' require 'i18n/tasks/scanners/results/occurrence' module I18n::Tasks::Scanners::AstMatchers diff --git a/lib/i18n/tasks/scanners/ruby_ast_scanner.rb b/lib/i18n/tasks/scanners/ruby_ast_scanner.rb index a69d5319..734cce99 100644 --- a/lib/i18n/tasks/scanners/ruby_ast_scanner.rb +++ b/lib/i18n/tasks/scanners/ruby_ast_scanner.rb @@ -3,6 +3,7 @@ require 'i18n/tasks/scanners/file_scanner' require 'i18n/tasks/scanners/relative_keys' require 'i18n/tasks/scanners/ruby_ast_call_finder' +require 'i18n/tasks/scanners/ast_matchers/default_i18n_subject_matcher' require 'i18n/tasks/scanners/ast_matchers/message_receivers_matcher' require 'i18n/tasks/scanners/ast_matchers/rails_model_matcher' require 'parser/current' diff --git a/spec/used_keys_erb_spec.rb b/spec/used_keys_erb_spec.rb index d9a81159..2f881f46 100644 --- a/spec/used_keys_erb_spec.rb +++ b/spec/used_keys_erb_spec.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'i18n/tasks/scanners/ast_matchers/rails_model_matcher' RSpec.describe 'UsedKeysErb' do let!(:task) { I18n::Tasks::BaseTask.new } diff --git a/spec/used_keys_ruby_spec.rb b/spec/used_keys_ruby_spec.rb index fff98d62..ce0c6e7d 100644 --- a/spec/used_keys_ruby_spec.rb +++ b/spec/used_keys_ruby_spec.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true require 'spec_helper' -require 'i18n/tasks/scanners/ast_matchers/rails_model_matcher' -require 'i18n/tasks/scanners/ast_matchers/default_i18n_subject_matcher' RSpec.describe 'UsedKeysRuby' do let!(:task) { I18n::Tasks::BaseTask.new } diff --git a/templates/config/i18n-tasks.yml b/templates/config/i18n-tasks.yml index 971f019e..10213ad7 100644 --- a/templates/config/i18n-tasks.yml +++ b/templates/config/i18n-tasks.yml @@ -96,8 +96,9 @@ search: ## Matches ActionMailer's default_i18n_subject method ## ## To implement your own, please see `I18n::Tasks::Scanners::AstMatchers::BaseMatcher`. - # <%# I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %> - # <%# I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher') %> + # ast_matchers: + # - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher' + # - 'I18n::Tasks::Scanners::AstMatchers::DefaultI18nSubjectMatcher' ## Multiple scanners can be used. Their results are merged. ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.