From 41466025cc6d9494d68c3e62ce352050c8564621 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Tue, 11 Apr 2023 00:19:09 +0100 Subject: [PATCH] dev-cmd/style: Properly clean up the `--display-cop-names` option - I remember making these changes as part of the RuboCop bump Dependabot PR (15136), but I must have not actually pushed them. Odd. --- .github/workflows/tests.yml | 28 ++++++++++++++-------------- Library/Homebrew/dev-cmd/audit.rb | 7 ++----- Library/Homebrew/dev-cmd/style.rb | 12 ++++++------ Library/Homebrew/style.rb | 1 - 4 files changed, 22 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6c7385767f..4f203e724d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -43,7 +43,7 @@ jobs: - name: Install shellcheck and shfmt run: brew install shellcheck shfmt - - run: brew style --display-cop-names + - run: brew style - run: brew typecheck @@ -83,7 +83,7 @@ jobs: run: brew install-bundler-gems --groups=sorbet - name: Run brew style on homebrew-core - run: brew style --display-cop-names homebrew/core + run: brew style homebrew/core - name: Set up all Homebrew taps run: | @@ -105,22 +105,22 @@ jobs: - name: Run brew style on official taps run: | - brew style --display-cop-names homebrew/bundle \ - homebrew/services \ - homebrew/test-bot + brew style homebrew/bundle \ + homebrew/services \ + homebrew/test-bot - brew style --display-cop-names homebrew/aliases\ - homebrew/autoupdate\ - homebrew/command-not-found \ - homebrew/formula-analytics \ - homebrew/portable-ruby + brew style homebrew/aliases \ + homebrew/autoupdate\ + homebrew/command-not-found \ + homebrew/formula-analytics \ + homebrew/portable-ruby - name: Run brew style on cask taps run: | - brew style --display-cop-names homebrew/cask \ - homebrew/cask-drivers \ - homebrew/cask-fonts \ - homebrew/cask-versions + brew style homebrew/cask \ + homebrew/cask-drivers \ + homebrew/cask-fonts \ + homebrew/cask-versions formula-audit: name: formula audit diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index db4a084d25..3003a9e9bf 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -60,7 +60,8 @@ module Homebrew switch "--fix", description: "Fix style violations automatically using RuboCop's auto-correct feature." switch "--display-cop-names", - description: "Include the RuboCop cop name for each violation in the output." + description: "Include the RuboCop cop name for each violation in the output. This is the default.", + hidden: true switch "--display-filename", description: "Prefix every line of output with the file or formula name being audited, to " \ "make output easy to grep." @@ -92,9 +93,6 @@ module Homebrew conflicts "--only", "--except" conflicts "--only-cops", "--except-cops", "--strict" conflicts "--only-cops", "--except-cops", "--only" - conflicts "--display-cop-names", "--skip-style" - conflicts "--display-cop-names", "--only-cops" - conflicts "--display-cop-names", "--except-cops" conflicts "--formula", "--cask" conflicts "--installed", "--all" @@ -208,7 +206,6 @@ module Homebrew spdx_license_data: spdx_license_data, spdx_exception_data: spdx_exception_data, style_offenses: style_offenses&.for_path(f.path), - display_cop_names: args.display_cop_names?, }.compact audit_proc = proc { FormulaAuditor.new(f, **options).tap(&:audit) } diff --git a/Library/Homebrew/dev-cmd/style.rb b/Library/Homebrew/dev-cmd/style.rb index d99973d591..01744ac29b 100644 --- a/Library/Homebrew/dev-cmd/style.rb +++ b/Library/Homebrew/dev-cmd/style.rb @@ -24,7 +24,8 @@ module Homebrew switch "--fix", description: "Fix style violations automatically using RuboCop's auto-correct feature." switch "--display-cop-names", - description: "Include the RuboCop cop name for each violation in the output." + description: "Include the RuboCop cop name for each violation in the output.", + hidden: true switch "--reset-cache", description: "Reset the RuboCop cache." switch "--formula", "--formulae", @@ -58,11 +59,10 @@ module Homebrew except_cops = args.except_cops options = { - fix: args.fix?, - display_cop_names: args.display_cop_names?, - reset_cache: args.reset_cache?, - debug: args.debug?, - verbose: args.verbose?, + fix: args.fix?, + reset_cache: args.reset_cache?, + debug: args.debug?, + verbose: args.verbose?, } if only_cops options[:only_cops] = only_cops diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 5ee84f893c..c0de31b8c8 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -101,7 +101,6 @@ module Homebrew end args += ["--extra-details"] if verbose - args += ["--display-cop-names"] if display_cop_names || verbose if except_cops except_cops.map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") }