Update rubocop to version 0.30.0
This commit is contained in:
parent
7abe274cba
commit
2514709594
116
.rubocop.yml
116
.rubocop.yml
|
@ -1,107 +1,59 @@
|
||||||
AllCops:
|
AllCops:
|
||||||
Include:
|
RunRailsCops: true
|
||||||
- 'Gemfile'
|
|
||||||
- 'Rakefile'
|
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'bin/*'
|
- 'bin/*'
|
||||||
- 'db/schema.rb'
|
- 'db/schema.rb'
|
||||||
- 'db/seeds.rb'
|
- 'db/seeds.rb'
|
||||||
- 'vendor/bundle/**/*'
|
- 'vendor/bundle/**/*'
|
||||||
|
|
||||||
# Avoid long parameter lists
|
Metrics/AbcSize:
|
||||||
ParameterLists:
|
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
|
Max: 4
|
||||||
CountKeywordArgs: true
|
CountKeywordArgs: true
|
||||||
|
|
||||||
ClassLength:
|
Style/AccessModifierIndentation:
|
||||||
Max: 100
|
EnforcedStyle: outdent
|
||||||
|
|
||||||
LineLength:
|
Style/CollectionMethods:
|
||||||
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:
|
|
||||||
PreferredMethods:
|
PreferredMethods:
|
||||||
map: 'collect'
|
map: 'collect'
|
||||||
reduce: 'inject'
|
reduce: 'inject'
|
||||||
find: 'detect'
|
find: 'detect'
|
||||||
find_all: 'select'
|
find_all: 'select'
|
||||||
|
|
||||||
# Disable documentation checking until a class needs to be documented once
|
Style/Documentation:
|
||||||
Documentation:
|
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
# Enforce Ruby 1.9-compatible hash syntax
|
Style/DotPosition:
|
||||||
HashSyntax:
|
EnforcedStyle: trailing
|
||||||
EnforcedStyle: ruby19
|
|
||||||
|
|
||||||
# No spaces inside hash literals
|
Style/DoubleNegation:
|
||||||
SpaceInsideHashLiteralBraces:
|
Enabled: false
|
||||||
|
|
||||||
|
Style/SpaceInsideHashLiteralBraces:
|
||||||
EnforcedStyle: no_space
|
EnforcedStyle: no_space
|
||||||
|
|
||||||
# Allow dots at the end of lines
|
Style/TrailingComma:
|
||||||
DotPosition:
|
EnforcedStyleForMultiline: 'comma'
|
||||||
Enabled: false
|
|
||||||
|
|
||||||
# Don't require magic comment at the top of every file
|
Style/WordArray:
|
||||||
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:
|
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/helpers/application_helper.rb'
|
- 'app/helpers/application_helper.rb'
|
||||||
|
|
||||||
NumericLiterals:
|
|
||||||
Exclude:
|
|
||||||
- 'db/seeds.rb'
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ rvm:
|
||||||
- 2.2.2
|
- 2.2.2
|
||||||
script:
|
script:
|
||||||
- bundle exec rake
|
- bundle exec rake
|
||||||
- bundle exec rubocop --rails --fail-level=refactor
|
- bundle exec rubocop
|
||||||
sudo: false
|
sudo: false
|
||||||
deploy:
|
deploy:
|
||||||
api_key:
|
api_key:
|
||||||
|
|
|
@ -177,7 +177,7 @@ GEM
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 3.0)
|
mime-types (>= 1.16, < 3.0)
|
||||||
netrc (~> 0.7)
|
netrc (~> 0.7)
|
||||||
rubocop (0.29.1)
|
rubocop (0.30.0)
|
||||||
astrolabe (~> 1.3)
|
astrolabe (~> 1.3)
|
||||||
parser (>= 2.2.0.1, < 3.0)
|
parser (>= 2.2.0.1, < 3.0)
|
||||||
powerpack (~> 0.1)
|
powerpack (~> 0.1)
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
class InfoWindowController < ApplicationController
|
class InfoWindowController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@thing = Thing.find_by_id(params[:thing_id])
|
@thing = Thing.find_by_id(params[:thing_id])
|
||||||
view = if @thing.adopted?
|
view = begin
|
||||||
|
if @thing.adopted?
|
||||||
user_signed_in? && current_user == @thing.user ? 'users/thank_you' : 'users/profile'
|
user_signed_in? && current_user == @thing.user ? 'users/thank_you' : 'users/profile'
|
||||||
else
|
else
|
||||||
user_signed_in? ? 'things/adopt' : 'users/sign_in'
|
user_signed_in? ? 'things/adopt' : 'users/sign_in'
|
||||||
end
|
end
|
||||||
|
end
|
||||||
render view
|
render view
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,7 +53,7 @@ module ApplicationHelper
|
||||||
['Washington', 'WA'],
|
['Washington', 'WA'],
|
||||||
['West Virginia', 'WV'],
|
['West Virginia', 'WV'],
|
||||||
['Wisconsin', 'WI'],
|
['Wisconsin', 'WI'],
|
||||||
['Wyoming', 'WY']
|
['Wyoming', 'WY'],
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue