Update rubocop to version 0.30.0

This commit is contained in:
Erik Michaels-Ober 2015-04-20 13:18:37 +01:00
parent 7abe274cba
commit 2514709594
5 changed files with 45 additions and 91 deletions

View File

@ -1,107 +1,59 @@
AllCops:
Include:
- 'Gemfile'
- 'Rakefile'
RunRailsCops: true
Exclude:
- 'bin/*'
- 'db/schema.rb'
- 'db/seeds.rb'
- 'vendor/bundle/**/*'
# Avoid long parameter lists
ParameterLists:
Metrics/AbcSize:
Exclude:
- 'app/controllers/passwords_controller.rb'
- 'app/controllers/sessions_controller.rb'
- 'app/controllers/users_controller.rb'
Metrics/BlockNesting:
Max: 2
Metrics/LineLength:
AllowURI: true
Enabled: false
Metrics/MethodLength:
CountComments: false
Max: 10
Exclude:
- 'db/migrate/*.rb'
Metrics/ParameterLists:
Max: 4
CountKeywordArgs: true
ClassLength:
Max: 100
Style/AccessModifierIndentation:
EnforcedStyle: outdent
LineLength:
Enabled: false
MethodLength:
CountComments: false
Max: 15
# Avoid more than `Max` levels of nesting.
BlockNesting:
Max: 2
AbcSize:
Enabled: false
# Align with the style guide.
CollectionMethods:
Style/CollectionMethods:
PreferredMethods:
map: 'collect'
reduce: 'inject'
find: 'detect'
find_all: 'select'
# Disable documentation checking until a class needs to be documented once
Documentation:
Style/Documentation:
Enabled: false
# Enforce Ruby 1.9-compatible hash syntax
HashSyntax:
EnforcedStyle: ruby19
Style/DotPosition:
EnforcedStyle: trailing
# No spaces inside hash literals
SpaceInsideHashLiteralBraces:
Style/DoubleNegation:
Enabled: false
Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space
# Allow dots at the end of lines
DotPosition:
Enabled: false
Style/TrailingComma:
EnforcedStyleForMultiline: 'comma'
# Don't require magic comment at the top of every file
Encoding:
Enabled: false
# Enforce outdenting of access modifiers (i.e. public, private, protected)
AccessModifierIndentation:
EnforcedStyle: outdent
EmptyLinesAroundAccessModifier:
Enabled: true
# Align ends correctly
EndAlignment:
AlignWith: variable
# Indentation of when/else
CaseIndentation:
IndentWhenRelativeTo: end
IndentOneStep: false
Lambda:
Enabled: false
RaiseArgs:
EnforcedStyle: compact
TrailingComma:
Enabled: false
DoubleNegation:
Enabled: false
PercentLiteralDelimiters:
PreferredDelimiters:
'%': ()
'%i': ()
'%q': ()
'%Q': ()
'%r': '{}'
'%s': ()
'%w': '[]'
'%W': '[]'
'%x': ()
WordArray:
Style/WordArray:
Exclude:
- 'app/helpers/application_helper.rb'
NumericLiterals:
Exclude:
- 'db/seeds.rb'

View File

@ -3,10 +3,10 @@ bundler_args: "--without assets:development:production"
cache: bundler
language: ruby
rvm:
- 2.2.2
- 2.2.2
script:
- bundle exec rake
- bundle exec rubocop --rails --fail-level=refactor
- bundle exec rake
- bundle exec rubocop
sudo: false
deploy:
api_key:

View File

@ -177,7 +177,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
rubocop (0.29.1)
rubocop (0.30.0)
astrolabe (~> 1.3)
parser (>= 2.2.0.1, < 3.0)
powerpack (~> 0.1)

View File

@ -1,10 +1,12 @@
class InfoWindowController < ApplicationController
def index
@thing = Thing.find_by_id(params[:thing_id])
view = if @thing.adopted?
user_signed_in? && current_user == @thing.user ? 'users/thank_you' : 'users/profile'
else
user_signed_in? ? 'things/adopt' : 'users/sign_in'
view = begin
if @thing.adopted?
user_signed_in? && current_user == @thing.user ? 'users/thank_you' : 'users/profile'
else
user_signed_in? ? 'things/adopt' : 'users/sign_in'
end
end
render view
end

View File

@ -53,7 +53,7 @@ module ApplicationHelper
['Washington', 'WA'],
['West Virginia', 'WV'],
['Wisconsin', 'WI'],
['Wyoming', 'WY']
['Wyoming', 'WY'],
]
end
end