Sha256: 7923fa0c8321e36b8d614021dd0e5ee04d0164c2df6e9cde2d5bf48045b1efaf

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

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_helpers'
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

9 entries across 9 versions & 1 rubygems

Version Path
cookstyle-5.11.0 lib/cookstyle.rb
cookstyle-5.10.13 lib/cookstyle.rb
cookstyle-5.10.11 lib/cookstyle.rb
cookstyle-5.9.3 lib/cookstyle.rb
cookstyle-5.8.1 lib/cookstyle.rb
cookstyle-5.7.0 lib/cookstyle.rb
cookstyle-5.6.5 lib/cookstyle.rb
cookstyle-5.6.2 lib/cookstyle.rb
cookstyle-5.5.7 lib/cookstyle.rb