aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-21 08:49:04 +0200
committerMarkus Reiter2016-09-23 15:30:06 +0200
commit240e49052cf113b74c0b2940531d7b6a28ab83af (patch)
treeb0b44fa5e1bea2ac8d42b42bc67ba70d1334af95 /Library
parent42efb44e7d942e9b96ec40f29e5c79e9f7b1e250 (diff)
downloadbrew-240e49052cf113b74c0b2940531d7b6a28ab83af.tar.bz2
Fix Performance/FixedSize.
Diffstat (limited to 'Library')
-rw-r--r--Library/.rubocop_todo.yml6
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb2
-rw-r--r--Library/Homebrew/dev-cmd/bottle.rb2
3 files changed, 2 insertions, 8 deletions
diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml
index 2f522a8fd..fde1d853f 100644
--- a/Library/.rubocop_todo.yml
+++ b/Library/.rubocop_todo.yml
@@ -86,12 +86,6 @@ Metrics/ModuleLength:
Metrics/ParameterLists:
Max: 6
-# Offense count: 2
-Performance/FixedSize:
- Exclude:
- - 'Homebrew/dev-cmd/audit.rb'
- - 'Homebrew/dev-cmd/bottle.rb'
-
# Offense count: 8
Style/AccessorMethodName:
Exclude:
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 20e9a8aff..55f545d0c 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -467,7 +467,7 @@ class FormulaAuditor
# Make sure the formula name plus description is no longer than 80 characters
# Note full_name includes the name of the tap, while name does not
- linelength = formula.name.length + ": ".length + desc.length
+ linelength = "#{formula.name}: #{desc}".length
if linelength > 80
problem <<-EOS.undent
Description is too long. \"name: desc\" should be less than 80 characters.
diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb
index f4d6a463a..fe07526f3 100644
--- a/Library/Homebrew/dev-cmd/bottle.rb
+++ b/Library/Homebrew/dev-cmd/bottle.rb
@@ -436,7 +436,7 @@ module Homebrew
puts output
update_or_add = "add"
if s.include? "stable do"
- indent = s.slice(/^ +stable do/).length - "stable do".length
+ indent = s.slice(/^( +)stable do/, 1).length
string = s.sub!(/^ {#{indent}}stable do(.|\n)+?^ {#{indent}}end\n/m, '\0' + output + "\n")
else
string = s.sub!(