diff options
| author | Mike McQuaid | 2016-09-19 11:20:06 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-19 11:20:06 +0100 |
| commit | 357cce11fe37c8df1a36c808d698fb901bee0d31 (patch) | |
| tree | fd6af002e9ed7a08e17da7d3331c438682c3ec25 /Library/Homebrew | |
| parent | 569dbf4d058302f0fa457d55f508ae250885d239 (diff) | |
| parent | 8a4f26f9522522ea938e79cb9e4651968f50045f (diff) | |
| download | brew-357cce11fe37c8df1a36c808d698fb901bee0d31.tar.bz2 | |
Merge pull request #1008 from MikeMcQuaid/more-rubocop
More Rubocop tweaks
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/style.rb | 16 | ||||
| -rw-r--r-- | Library/Homebrew/compat/.rubocop.yml | 7 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/test-bot.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/.rubocop.yml | 5 |
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 |
