#!/usr/bin/env ruby # frozen_string_literal: true $LOAD_PATH.unshift File.join(__dir__, %w(.. lib)) if ARGV.include?('--chefstyle') ARGV.delete('--chefstyle') require 'cookstyle/chefstyle' else require 'cookstyle' end # force the fail level to :convention so that we can set all our new rules to # the lowest level of :refactor without failing everyone's CI jobs unless ARGV.include?('--fail-level') ARGV << '--fail-level' ARGV << 'C' end # we want to link to our docs unless ARGV.include?('--display-style-guide') ARGV << '--display-style-guide' end # if only -v is passed we'll get 4 args (-v, --fail-level. --display-style-guide, and C) if ARGV.size == 4 && %w(-v --version).include?(ARGV.first) puts "Cookstyle #{Cookstyle::VERSION}" print ' * RuboCop ' end load Gem.bin_path('rubocop', 'rubocop')