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
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,11 +105,11 @@ jobs:
- name: Run brew style on official taps
run: |
brew style --display-cop-names homebrew/bundle \
brew style homebrew/bundle \
homebrew/services \
homebrew/test-bot
brew style --display-cop-names homebrew/aliases\
brew style homebrew/aliases \
homebrew/autoupdate\
homebrew/command-not-found \
homebrew/formula-analytics \
@ -117,7 +117,7 @@ jobs:
- name: Run brew style on cask taps
run: |
brew style --display-cop-names homebrew/cask \
brew style homebrew/cask \
homebrew/cask-drivers \
homebrew/cask-fonts \
homebrew/cask-versions

View File

@ -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) }

View File

@ -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",
@ -59,7 +60,6 @@ module Homebrew
options = {
fix: args.fix?,
display_cop_names: args.display_cop_names?,
reset_cache: args.reset_cache?,
debug: args.debug?,
verbose: args.verbose?,

View File

@ -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, "") }