aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-21 09:48:24 +0200
committerMarkus Reiter2016-09-23 15:30:06 +0200
commit0b473ebba9c84724274d8d49d1ddc88de3479b7f (patch)
tree80613314850916227ea0e7b2388e5934b4747c89 /Library
parent9ce3c8d8a4059be6187dfcfd3daddfa7ef48c656 (diff)
downloadbrew-0b473ebba9c84724274d8d49d1ddc88de3479b7f.tar.bz2
Fix Style/PredicateName.
Diffstat (limited to 'Library')
-rw-r--r--Library/.rubocop_rules.yml1
-rw-r--r--Library/.rubocop_todo.yml11
-rw-r--r--Library/Homebrew/cask/.rubocop.yml3
-rw-r--r--Library/Homebrew/download_strategy.rb8
4 files changed, 5 insertions, 18 deletions
diff --git a/Library/.rubocop_rules.yml b/Library/.rubocop_rules.yml
index 915b2e570..c5a0018f8 100644
--- a/Library/.rubocop_rules.yml
+++ b/Library/.rubocop_rules.yml
@@ -145,6 +145,7 @@ Style/MethodName:
Style/PredicateName:
Exclude:
- 'Homebrew/compat/**/*'
+ NameWhitelist: is_32_bit?, is_64_bit?
# `formula do` uses nested method definitions
Lint/NestedMethodDefinition:
diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml
index 0b29efe30..47a262a76 100644
--- a/Library/.rubocop_todo.yml
+++ b/Library/.rubocop_todo.yml
@@ -281,17 +281,6 @@ Style/OpMethod:
- 'Homebrew/install_renamed.rb'
- 'Homebrew/options.rb'
-# Offense count: 4
-# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
-# NamePrefix: is_, has_, have_
-# NamePrefixBlacklist: is_, has_, have_
-# NameWhitelist: is_a?
-Style/PredicateName:
- Exclude:
- - 'Homebrew/compat/**/*'
- - 'Homebrew/download_strategy.rb'
- - 'Homebrew/hardware.rb'
-
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
diff --git a/Library/Homebrew/cask/.rubocop.yml b/Library/Homebrew/cask/.rubocop.yml
index 08696fdb8..076b87f61 100644
--- a/Library/Homebrew/cask/.rubocop.yml
+++ b/Library/Homebrew/cask/.rubocop.yml
@@ -115,9 +115,6 @@ Style/PercentLiteralDelimiters:
'%W': '[]'
'%x': '()'
-Style/PredicateName:
- NameWhitelist: is_32_bit?, is_64_bit?
-
Style/RaiseArgs:
EnforcedStyle: exploded
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 2762f01b0..d19d131a7 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -663,7 +663,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
@shallow && support_depth?
end
- def is_shallow_clone?
+ def shallow_dir?
git_dir.join("shallow").exist?
end
@@ -675,7 +675,7 @@ class GitDownloadStrategy < VCSDownloadStrategy
cached_location.join(".git")
end
- def has_ref?
+ def ref?
quiet_system "git", "--git-dir", git_dir, "rev-parse", "-q", "--verify", "#{@ref}^{commit}"
end
@@ -717,8 +717,8 @@ class GitDownloadStrategy < VCSDownloadStrategy
end
def update_repo
- if @ref_type == :branch || !has_ref?
- if !shallow_clone? && is_shallow_clone?
+ if @ref_type == :branch || !ref?
+ if !shallow_clone? && shallow_dir?
quiet_safe_system "git", "fetch", "origin", "--unshallow"
else
quiet_safe_system "git", "fetch", "origin"