Skip to content

Commit

Permalink
Upgrade cops and tweak som offences.
Browse files Browse the repository at this point in the history
  • Loading branch information
futhr committed Jun 21, 2015
1 parent 385da27 commit 59e2ab3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
19 changes: 11 additions & 8 deletions .hound.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
---
# Too picky.
LineLength:
Metrics/LineLength:
Enabled: false

# This should truly be on for well documented gems.
Documentation:
Style/Documentation:
Enabled: false

# Neatly aligned code is to swell.
SingleSpaceBeforeFirstArg:
Style/SingleSpaceBeforeFirstArg:
Enabled: false

# Rubocop default is leading but hound-ci use trailing.
DotPosition:
Style/DotPosition:
EnforcedStyle: leading

# Don't mess with RSpec DSL.
Blocks:
Style/BlockDelimiters:
Exclude:
- 'spec/**/*'

# We really like the readability with newline in beginning of classes.
EmptyLinesAroundMethodBody:
Style/EmptyLinesAroundMethodBody:
Enabled: false

EmptyLinesAroundClassBody:
Style/EmptyLinesAroundClassBody:
Enabled: false

EmptyLinesAroundModuleBody:
Style/EmptyLinesAroundModuleBody:
Enabled: false

Metrics/AbcSize:
Enabled: false
8 changes: 5 additions & 3 deletions lib/spree/calculator/shipping/postal_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def register

def item_oversized?(variant)
sizes = [
variant.width ? variant.width : 0,
variant.depth ? variant.depth : 0,
variant.width ? variant.width : 0,
variant.depth ? variant.depth : 0,
variant.height ? variant.height : 0
].sort.reverse

Expand All @@ -50,7 +50,9 @@ def available?(package)
# Coupon, ShippingMethod or ShippingRate.
def compute(package)
@line_items ||= package.order.line_items
total_price, total_weight, shipping = compute_total_price, compute_total_weight, 0
total_price = compute_total_price
total_weight = compute_total_weight
shipping = 0

return 0.0 if total_price > preferred_max_price

Expand Down

0 comments on commit 59e2ab3

Please sign in to comment.