diff --git a/Library/Homebrew/dev-cmd/style.rb b/Library/Homebrew/dev-cmd/style.rb index 80ac45a233..a38f5b2363 100644 --- a/Library/Homebrew/dev-cmd/style.rb +++ b/Library/Homebrew/dev-cmd/style.rb @@ -51,7 +51,7 @@ module Homebrew only_cops = args.only_cops except_cops = args.except_cops - options = { fix: args.fix? } + options = { fix: args.fix?, display_cop_names: args.display_cop_names? } if only_cops options[:only_cops] = only_cops elsif except_cops diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index d36ebf37a6..c7a94df76b 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -16,7 +16,7 @@ module Homebrew check_style_impl(files, :json, **options) end - def check_style_impl(files, output_type, fix: false, except_cops: nil, only_cops: nil) + def check_style_impl(files, output_type, fix: false, except_cops: nil, only_cops: nil, display_cop_names: false) Homebrew.install_bundler_gems! require "rubocop" require "rubocops" @@ -78,7 +78,7 @@ module Homebrew case output_type when :print args << "--debug" if Homebrew.args.debug? - args << "--display-cop-names" if Homebrew.args.display_cop_names? + args << "--display-cop-names" if display_cop_names args << "--format" << "simple" if files.present? system(cache_env, "rubocop", *args) rubocop_success = $CHILD_STATUS.success?