def rule_file_tags(file)
      cookbook = cookbook_dir(file)
      @tag_cache ||= {}

      # lookup the tags in the cache has and return that if we find something
      cb_tags = @tag_cache[cookbook]
      return cb_tags unless cb_tags.nil?

      # if a rule file has been specified use that. Otherwise use the .foodcritic file in the CB
      tags = if @options[:rule_file]
               raise "ERROR: Could not find the specified rule file at #{@options[:rule_file]}" unless File.exist?(@options[:rule_file])
               parse_rule_file(@options[:rule_file])
             else
               File.exist?("#{cookbook}/.foodcritic") ? parse_rule_file("#{cookbook}/.foodcritic") : []
             end

      @tag_cache[cookbook] = tags
      tags
    end
def rule_file_tags(file)
      cookbook = cookbook_dir(file)
      @tag_cache ||= {}

      # lookup the tags in the cache has and return that if we find something
      cb_tags = @tag_cache[cookbook]
      return cb_tags unless cb_tags.nil?

      # if a rule file has been specified use that. Otherwise use the .foodcritic file in the CB
      tags = if @options[:rule_file]
               raise "ERROR: Could not find the specified rule file at #{@options[:rule_file]}" unless File.exist?(@options[:rule_file])
               parse_rule_file(@options[:rule_file])
             else
               File.exist?("#{cookbook}/.foodcritic") ? parse_rule_file("#{cookbook}/.foodcritic") : []
             end

      @tag_cache[cookbook] = tags
      tags
    end
given a file in the cookbook lookup all the applicable tag rules defined in rule
 files. The rule file is either that specified via CLI or the .foodcritic file
 in the cookbook. We cache this information at the cookbook level to prevent looking
  up the same thing dozens of times

 @param [String] file in the cookbook
 @return [Array] array of tag rules