Sha256: 8d3d2b06f4a7660eba638248069e5dcf28ed8df80bceaffcce14d091931be7a0

Contents?: true

Size: 1.57 KB

Versions: 33

Compression:

Stored size: 1.57 KB

Contents

# frozen_string_literal: true
require_relative 'cookstyle/version'

require 'pathname' unless defined?(Pathname)
require 'yaml' unless defined?(YAML)

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

# monkey patches needed for the TargetChefVersion config option
require_relative 'rubocop/monkey_patches/config'
require_relative 'rubocop/monkey_patches/base'
require_relative 'rubocop/monkey_patches/team'
require_relative 'rubocop/monkey_patches/registry_cop'

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

    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_relative 'rubocop/chef'
require_relative 'rubocop/chef/autocorrect_helpers'
require_relative 'rubocop/chef/cookbook_helpers'
require_relative 'rubocop/chef/platform_helpers'
require_relative 'rubocop/chef/cookbook_only'
require_relative 'rubocop/cop/target_chef_version'

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

  require_relative file # not actually relative but require_relative is faster
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
cookstyle-7.32.2 lib/cookstyle.rb
cookstyle-7.32.1 lib/cookstyle.rb
cookstyle-7.32.0 lib/cookstyle.rb
cookstyle-7.31.9 lib/cookstyle.rb
cookstyle-7.31.7 lib/cookstyle.rb
cookstyle-7.31.3 lib/cookstyle.rb
cookstyle-7.31.1 lib/cookstyle.rb
cookstyle-7.31.0 lib/cookstyle.rb
cookstyle-7.30.4 lib/cookstyle.rb
cookstyle-7.30.3 lib/cookstyle.rb
cookstyle-7.30.1 lib/cookstyle.rb
cookstyle-7.28.2 lib/cookstyle.rb
cookstyle-7.27.0 lib/cookstyle.rb
cookstyle-7.26.1 lib/cookstyle.rb
cookstyle-7.25.10 lib/cookstyle.rb
cookstyle-7.25.9 lib/cookstyle.rb
cookstyle-7.25.8 lib/cookstyle.rb
cookstyle-7.25.6 lib/cookstyle.rb
cookstyle-7.24.1 lib/cookstyle.rb
cookstyle-7.23.0 lib/cookstyle.rb