aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/cmd/style.rb16
-rw-r--r--Library/Homebrew/compat/.rubocop.yml7
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb4
-rw-r--r--Library/Homebrew/test/.rubocop.yml5
4 files changed, 11 insertions, 21 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
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/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
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