Sha256: fcc5895cb4cc15c696640c33a1228633373f59154fafddf9642f52ceb67bd75b

Contents?: true

Size: 950 Bytes

Versions: 31

Compression:

Stored size: 950 Bytes

Contents

# frozen_string_literal: true
require_relative "chefstyle/version"

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

module RuboCop
  class ConfigLoader
    RUBOCOP_HOME.gsub!(
      /^.*$/,
      File.realpath(File.join(__dir__, ".."))
    )

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

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

require_relative "rubocop/chef"

# Chef custom cops
Dir.glob(__dir__ + "/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

31 entries across 31 versions & 1 rubygems

Version Path
chefstyle-2.2.2 lib/chefstyle.rb
chefstyle-2.2.1 lib/chefstyle.rb
chefstyle-2.2.0 lib/chefstyle.rb
chefstyle-2.1.3 lib/chefstyle.rb
chefstyle-2.1.2 lib/chefstyle.rb
chefstyle-2.1.1 lib/chefstyle.rb
chefstyle-2.1.0 lib/chefstyle.rb
chefstyle-2.0.9 lib/chefstyle.rb
chefstyle-2.0.8 lib/chefstyle.rb
chefstyle-2.0.7 lib/chefstyle.rb
chefstyle-2.0.6 lib/chefstyle.rb
chefstyle-2.0.5 lib/chefstyle.rb
chefstyle-2.0.4 lib/chefstyle.rb
chefstyle-2.0.3 lib/chefstyle.rb
chefstyle-1.7.5 lib/chefstyle.rb
chefstyle-1.7.4 lib/chefstyle.rb
chefstyle-1.7.2 lib/chefstyle.rb
chefstyle-1.7.1 lib/chefstyle.rb
chefstyle-1.6.2 lib/chefstyle.rb
chefstyle-1.6.1 lib/chefstyle.rb