Merge pull request #9533 from hyuraku/style-add-two-options
style: add two options
This commit is contained in:
commit
632c9be369
@ -29,6 +29,10 @@ module Homebrew
|
|||||||
description: "Include the RuboCop cop name for each violation in the output."
|
description: "Include the RuboCop cop name for each violation in the output."
|
||||||
switch "--reset-cache",
|
switch "--reset-cache",
|
||||||
description: "Reset the RuboCop cache."
|
description: "Reset the RuboCop cache."
|
||||||
|
switch "--formula", "--formulae",
|
||||||
|
description: "Treat all named arguments as formulae."
|
||||||
|
switch "--cask", "--casks",
|
||||||
|
description: "Treat all named arguments as casks."
|
||||||
comma_array "--only-cops",
|
comma_array "--only-cops",
|
||||||
description: "Specify a comma-separated <cops> list to check for violations of only the "\
|
description: "Specify a comma-separated <cops> list to check for violations of only the "\
|
||||||
"listed RuboCop cops."
|
"listed RuboCop cops."
|
||||||
@ -36,6 +40,7 @@ module Homebrew
|
|||||||
description: "Specify a comma-separated <cops> list to skip checking for violations of the "\
|
description: "Specify a comma-separated <cops> list to skip checking for violations of the "\
|
||||||
"listed RuboCop cops."
|
"listed RuboCop cops."
|
||||||
|
|
||||||
|
conflicts "--formula", "--cask"
|
||||||
conflicts "--only-cops", "--except-cops"
|
conflicts "--only-cops", "--except-cops"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -43,10 +48,13 @@ module Homebrew
|
|||||||
def style
|
def style
|
||||||
args = style_args.parse
|
args = style_args.parse
|
||||||
|
|
||||||
|
only = :formula if args.formula? && !args.cask?
|
||||||
|
only = :cask if args.cask? && !args.formula?
|
||||||
|
|
||||||
target = if args.no_named?
|
target = if args.no_named?
|
||||||
nil
|
nil
|
||||||
else
|
else
|
||||||
args.named.to_paths
|
args.named.to_paths(only: only)
|
||||||
end
|
end
|
||||||
|
|
||||||
only_cops = args.only_cops
|
only_cops = args.only_cops
|
||||||
|
|||||||
@ -1243,6 +1243,10 @@ including core code and all formulae.
|
|||||||
Include the RuboCop cop name for each violation in the output.
|
Include the RuboCop cop name for each violation in the output.
|
||||||
* `--reset-cache`:
|
* `--reset-cache`:
|
||||||
Reset the RuboCop cache.
|
Reset the RuboCop cache.
|
||||||
|
* `--formula`:
|
||||||
|
Treat all named arguments as formulae.
|
||||||
|
* `--cask`:
|
||||||
|
Treat all named arguments as casks.
|
||||||
* `--only-cops`:
|
* `--only-cops`:
|
||||||
Specify a comma-separated *`cops`* list to check for violations of only the listed RuboCop cops.
|
Specify a comma-separated *`cops`* list to check for violations of only the listed RuboCop cops.
|
||||||
* `--except-cops`:
|
* `--except-cops`:
|
||||||
|
|||||||
@ -1724,6 +1724,14 @@ Include the RuboCop cop name for each violation in the output\.
|
|||||||
Reset the RuboCop cache\.
|
Reset the RuboCop cache\.
|
||||||
.
|
.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-formula\fR
|
||||||
|
Treat all named arguments as formulae\.
|
||||||
|
.
|
||||||
|
.TP
|
||||||
|
\fB\-\-cask\fR
|
||||||
|
Treat all named arguments as casks\.
|
||||||
|
.
|
||||||
|
.TP
|
||||||
\fB\-\-only\-cops\fR
|
\fB\-\-only\-cops\fR
|
||||||
Specify a comma\-separated \fIcops\fR list to check for violations of only the listed RuboCop cops\.
|
Specify a comma\-separated \fIcops\fR list to check for violations of only the listed RuboCop cops\.
|
||||||
.
|
.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user