# frozen_string_literal: true module NeetoCompliance class SidekiqQueuesVerifier < Base def local_copy "config/sidekiq.yml" end def queues @_queues ||= ["active_storage_analysis", "active_storage_purge"] end def valid? @errors = [] sidekiq_yml = YAML.load(File.open(local_copy), aliases: true) queues.map do |queue| unless sidekiq_yml["queues"].include?(queue) @errors << "Add #{queue} to queues in #{local_copy}" end end @errors.length == 0 end def autofix_suggestion @errors.join("\n").yellow end def auto_correct! end end end