From 515f7b52553b7f5f10904f2b3972260ae223c6e8 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 14:27:09 +0100 Subject: Unify .rubocopy.yml files. --- Library/Homebrew/compat/.rubocop.yml | 7 ------- Library/Homebrew/test/.rubocop.yml | 5 ----- 2 files changed, 12 deletions(-) delete mode 100644 Library/Homebrew/compat/.rubocop.yml delete mode 100644 Library/Homebrew/test/.rubocop.yml (limited to 'Library/Homebrew') diff --git a/Library/Homebrew/compat/.rubocop.yml b/Library/Homebrew/compat/.rubocop.yml deleted file mode 100644 index c07e24891..000000000 --- a/Library/Homebrew/compat/.rubocop.yml +++ /dev/null @@ -1,7 +0,0 @@ -inherit_from: ../../.rubocop.yml - -# We won't change method or predicate names because of backward compatibility. -Style/MethodName: - Enabled: false -Style/PredicateName: - Enabled: false diff --git a/Library/Homebrew/test/.rubocop.yml b/Library/Homebrew/test/.rubocop.yml deleted file mode 100644 index 6f1bcba97..000000000 --- a/Library/Homebrew/test/.rubocop.yml +++ /dev/null @@ -1,5 +0,0 @@ -inherit_from: ../../.rubocop.yml - -# `formula do` uses nested method definitions -Lint/NestedMethodDefinition: - Enabled: false -- cgit v1.2.3 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') 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') 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') 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 From 8a4f26f9522522ea938e79cb9e4651968f50045f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 14:28:44 +0100 Subject: test-bot: run `brew style`. --- Library/Homebrew/dev-cmd/test-bot.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Library/Homebrew') diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb index f817d5d4d..41e5a89f3 100644 --- a/Library/Homebrew/dev-cmd/test-bot.rb +++ b/Library/Homebrew/dev-cmd/test-bot.rb @@ -719,6 +719,7 @@ module Homebrew test "brew", "update-test", "--commit=HEAD" end + test "brew", "style" test "brew", "readall", "--syntax" coverage_args = [] @@ -741,6 +742,9 @@ module Homebrew test "brew", "cask-tests", *coverage_args end elsif @tap + if @tap.name == "homebrew/core" + test "brew", "style", @tap.name + end test "brew", "readall", "--aliases", @tap.name end end -- cgit v1.2.3