diff options
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 9540e853d..f28d50cc1 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -1,16 +1,12 @@ -#: * `style` [`--fix`] [`--display-cop-names`] [<formulae>|<files>]: +#: * `style` [`--fix`] [`--display-cop-names`] [<files>|<taps>|<formulae>]: #: Check formulae or files for conformance to Homebrew style guidelines. #: -#: <formulae> is a list of formula names. -#: -#: <files> is a list of file names. -#: #: <formulae> and <files> may not be combined. If both are omitted, style will run #: style checks on the whole Homebrew `Library`, including core code and all #: formulae. #: -#: If `--fix` is passed and `HOMEBREW_DEVELOPER` is set, style violations -#: will be automatically fixed using RuboCop's `--auto-correct` feature. +#: If `--fix` is passed, style violations will be automatically fixed using +#: RuboCop's `--auto-correct` feature. #: #: If `--display-cop-names` is passed, the RuboCop cop name for each violation #: is included in the output. @@ -23,9 +19,11 @@ require "utils/json" module Homebrew def style target = if ARGV.named.empty? - [HOMEBREW_LIBRARY] + [HOMEBREW_LIBRARY_PATH] elsif ARGV.named.any? { |file| File.exist? file } ARGV.named + elsif ARGV.named.any? { |tap| tap.count("/") == 1 } + ARGV.named.map { |tap| Tap.fetch(tap).path } else ARGV.formulae.map(&:path) end @@ -53,7 +51,7 @@ module Homebrew --force-exclusion --config #{HOMEBREW_LIBRARY}/.rubocop.yml ] - args << "--auto-correct" if ARGV.homebrew_developer? && fix + args << "--auto-correct" if fix args += files case output_type |
