Sha256: 06b2f0451549de8d9f67d9e2a3b271ea2f57680d9d578b2e2ef1a7cb626295ab

Contents?: true

Size: 1006 Bytes

Versions: 4

Compression:

Stored size: 1006 Bytes

Contents

require 'cookstyle/version'

require 'pathname'
require 'yaml'

# ensure the desired target version of RuboCop is gem activated
gem 'rubocop', "= #{Cookstyle::RUBOCOP_VERSION}"
require 'rubocop'

module RuboCop
  class ConfigLoader
    RUBOCOP_HOME.gsub!(
      /^.*$/,
      File.realpath(File.join(File.dirname(__FILE__), '..'))
    )

    DEFAULT_FILE.gsub!(
      /^.*$/,
      File.join(RUBOCOP_HOME, 'config', 'default.yml')
    )
  end
end

# Cookstyle patches the RuboCop tool to set a new default configuration that
# is vendored in the Cookstyle codebase.
module Cookstyle
  # @return [String] the absolute path to the main RuboCop configuration YAML file
  def self.config
    RuboCop::ConfigLoader::DEFAULT_FILE
  end
end

require 'rubocop/chef'
require 'rubocop/chef/cookbook_only'

# Chef specific cops
Dir.glob(File.dirname(__FILE__) + '/rubocop/cop/chef/**/*.rb') do |file|
  next if File.directory?(file)

  require_relative file # not actually relative but require_relative is faster
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cookstyle-5.4.13 lib/cookstyle.rb
cookstyle-5.3.6 lib/cookstyle.rb
cookstyle-5.2.17 lib/cookstyle.rb
cookstyle-5.1.19 lib/cookstyle.rb