Merge pull request #15196 from issyl0/really-delete-style-display-cop-names

dev-cmd/style: Properly clean up the `--display-cop-names` option
This commit is contained in:
Mike McQuaid 2023-04-11 09:23:14 +01:00 committed by GitHub
commit a59c8cf844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 26 deletions

View File

@ -43,7 +43,7 @@ jobs:
- name: Install shellcheck and shfmt - name: Install shellcheck and shfmt
run: brew install shellcheck shfmt run: brew install shellcheck shfmt
- run: brew style --display-cop-names - run: brew style
- run: brew typecheck - run: brew typecheck
@ -83,7 +83,7 @@ jobs:
run: brew install-bundler-gems --groups=sorbet run: brew install-bundler-gems --groups=sorbet
- name: Run brew style on homebrew-core - 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 - name: Set up all Homebrew taps
run: | run: |
@ -105,22 +105,22 @@ jobs:
- name: Run brew style on official taps - name: Run brew style on official taps
run: | run: |
brew style --display-cop-names homebrew/bundle \ brew style homebrew/bundle \
homebrew/services \ homebrew/services \
homebrew/test-bot homebrew/test-bot
brew style --display-cop-names homebrew/aliases\ brew style homebrew/aliases \
homebrew/autoupdate\ homebrew/autoupdate\
homebrew/command-not-found \ homebrew/command-not-found \
homebrew/formula-analytics \ homebrew/formula-analytics \
homebrew/portable-ruby homebrew/portable-ruby
- name: Run brew style on cask taps - name: Run brew style on cask taps
run: | run: |
brew style --display-cop-names homebrew/cask \ brew style homebrew/cask \
homebrew/cask-drivers \ homebrew/cask-drivers \
homebrew/cask-fonts \ homebrew/cask-fonts \
homebrew/cask-versions homebrew/cask-versions
formula-audit: formula-audit:
name: formula audit name: formula audit

View File

@ -60,7 +60,8 @@ module Homebrew
switch "--fix", switch "--fix",
description: "Fix style violations automatically using RuboCop's auto-correct feature." description: "Fix style violations automatically using RuboCop's auto-correct feature."
switch "--display-cop-names", 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", switch "--display-filename",
description: "Prefix every line of output with the file or formula name being audited, to " \ description: "Prefix every line of output with the file or formula name being audited, to " \
"make output easy to grep." "make output easy to grep."
@ -92,9 +93,6 @@ module Homebrew
conflicts "--only", "--except" conflicts "--only", "--except"
conflicts "--only-cops", "--except-cops", "--strict" conflicts "--only-cops", "--except-cops", "--strict"
conflicts "--only-cops", "--except-cops", "--only" 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 "--formula", "--cask"
conflicts "--installed", "--all" conflicts "--installed", "--all"
@ -208,7 +206,6 @@ module Homebrew
spdx_license_data: spdx_license_data, spdx_license_data: spdx_license_data,
spdx_exception_data: spdx_exception_data, spdx_exception_data: spdx_exception_data,
style_offenses: style_offenses&.for_path(f.path), style_offenses: style_offenses&.for_path(f.path),
display_cop_names: args.display_cop_names?,
}.compact }.compact
audit_proc = proc { FormulaAuditor.new(f, **options).tap(&:audit) } audit_proc = proc { FormulaAuditor.new(f, **options).tap(&:audit) }

View File

@ -24,7 +24,8 @@ module Homebrew
switch "--fix", switch "--fix",
description: "Fix style violations automatically using RuboCop's auto-correct feature." description: "Fix style violations automatically using RuboCop's auto-correct feature."
switch "--display-cop-names", 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", switch "--reset-cache",
description: "Reset the RuboCop cache." description: "Reset the RuboCop cache."
switch "--formula", "--formulae", switch "--formula", "--formulae",
@ -58,11 +59,10 @@ module Homebrew
except_cops = args.except_cops except_cops = args.except_cops
options = { options = {
fix: args.fix?, fix: args.fix?,
display_cop_names: args.display_cop_names?, reset_cache: args.reset_cache?,
reset_cache: args.reset_cache?, debug: args.debug?,
debug: args.debug?, verbose: args.verbose?,
verbose: args.verbose?,
} }
if only_cops if only_cops
options[:only_cops] = only_cops options[:only_cops] = only_cops

View File

@ -101,7 +101,6 @@ module Homebrew
end end
args += ["--extra-details"] if verbose args += ["--extra-details"] if verbose
args += ["--display-cop-names"] if display_cop_names || verbose
if except_cops if except_cops
except_cops.map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") } except_cops.map! { |cop| RuboCop::Cop::Cop.registry.qualified_cop_name(cop.to_s, "") }