From e79f62b2ead91decb3a255167d6a87020a0ad7ab Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 14:28:03 +0100 Subject: style: allow passing taps as arguments. --- Library/Homebrew/cmd/style.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 9540e853d..11c7e6773 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -1,10 +1,6 @@ -#: * `style` [`--fix`] [`--display-cop-names`] [|]: +#: * `style` [`--fix`] [`--display-cop-names`] [||]: #: Check formulae or files for conformance to Homebrew style guidelines. #: -#: is a list of formula names. -#: -#: is a list of file names. -#: #: and may not be combined. If both are omitted, style will run #: style checks on the whole Homebrew `Library`, including core code and all #: formulae. @@ -26,6 +22,8 @@ module Homebrew [HOMEBREW_LIBRARY] 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 -- cgit v1.2.3 From 3686243e5a6003051b0b5c8943e74cb88278d389 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 14:28:19 +0100 Subject: style: don't require HOMEBREW_DEVELOPER to fix. --- Library/Homebrew/cmd/style.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 11c7e6773..229feca4d 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -5,8 +5,8 @@ #: 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. @@ -51,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 -- cgit v1.2.3 From 263a8a0b73b059f1edac750b9864a94232c18603 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 14:28:31 +0100 Subject: style: no args default to Library/Homebrew. --- Library/Homebrew/cmd/style.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library/Homebrew/cmd') diff --git a/Library/Homebrew/cmd/style.rb b/Library/Homebrew/cmd/style.rb index 229feca4d..f28d50cc1 100644 --- a/Library/Homebrew/cmd/style.rb +++ b/Library/Homebrew/cmd/style.rb @@ -19,7 +19,7 @@ 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 } -- cgit v1.2.3