From fd6a6804b4bed3a56fb2087f05666ff872091625 Mon Sep 17 00:00:00 2001 From: Jason Frey Date: Mon, 1 Jul 2024 14:28:12 -0400 Subject: [PATCH] Better update mechanism for manageiq-style --- .../manageiq-style.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/pull_request_blaster_outer/manageiq-style.rb b/scripts/pull_request_blaster_outer/manageiq-style.rb index cd03201..8786ab9 100755 --- a/scripts/pull_request_blaster_outer/manageiq-style.rb +++ b/scripts/pull_request_blaster_outer/manageiq-style.rb @@ -1,6 +1,19 @@ #! /usr/bin/env ruby -require 'bundler/setup' -require 'manageiq-style' +require 'bundler/inline' +gemfile do + gem 'manageiq-style', '>=1.5.0', :path => File.expand_path("~/dev/manageiq-style") + gem 'multi_repo', '>=0.3.1' + gem 'colorize' +end -ManageIQ::Style::CLI.new(:install => true).run +gemfile = Dir.glob("Gemfile").first +gemfile_ref = gemfile && File.read(gemfile).include?("manageiq-style") +gemspec = Dir.glob("*.gemspec").first +gemspec_ref = gemspec && File.read(gemspec).include?("manageiq-style") + +if File.exist?(".codeclimate.yml") && (gemfile_ref || gemspec_ref) + ManageIQ::Style::CLI.new(:install => true, :yamllint => false, :hamllint => false).run +else + puts "!! Skipping since .codeclimate.yml was not found".light_yellow +end