Merge pull request #5118 from reitermarkus/brew-cask-style

Run `rubocop` in temporary directory to skip reading parent config.
This commit is contained in:
Markus Reiter 2018-10-16 22:00:37 +02:00 committed by GitHub
commit dbf5d5b222
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,9 @@ module Cask
install_rubocop
cache_env = { "XDG_CACHE_HOME" => "#{HOMEBREW_CACHE}/style" }
hide_warnings = debug? ? [] : [ENV["HOMEBREW_RUBY_PATH"], "-W0", "-S"]
system(cache_env, *hide_warnings, "rubocop", *rubocop_args, "--", *cask_paths)
Dir.mktmpdir do |tmpdir|
system(cache_env, *hide_warnings, "rubocop", *rubocop_args, "--", *cask_paths, chdir: tmpdir)
end
raise CaskError, "style check failed" unless $CHILD_STATUS.success?
end