aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2016-09-19 11:20:06 +0100
committerGitHub2016-09-19 11:20:06 +0100
commit357cce11fe37c8df1a36c808d698fb901bee0d31 (patch)
treefd6af002e9ed7a08e17da7d3331c438682c3ec25 /Library/Homebrew/cmd
parent569dbf4d058302f0fa457d55f508ae250885d239 (diff)
parent8a4f26f9522522ea938e79cb9e4651968f50045f (diff)
downloadbrew-357cce11fe37c8df1a36c808d698fb901bee0d31.tar.bz2
Merge pull request #1008 from MikeMcQuaid/more-rubocop
More Rubocop tweaks
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/style.rb16
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