Fix RuboCop 0.40 linter errors (#1722)

These errors are breaking the build, which seems to use RuboCop 0.40 [1]
despite the Gemfile.lock pinning rubocop to 0.38.

New lints that I am updating the code style to reflect:

- Style/EmptyCaseCondition: Do not use empty case condition, instead use
  an if expression.

- Style/MultilineArrayBraceLayout: Closing array brace must be on the
  same line as the last array element when opening brace is on the same
  line as the first array element.

- Style/MultilineHashBraceLayout: Closing hash brace must be on the same
  line as the last hash element when opening brace is on the same line
  as the first hash element.

- Style/MultilineMethodCallBraceLayout: Closing method call brace must
  be on the line after the last argument when opening brace is on a
  separate line from the first argument.

[1] https://github.com/bbatsov/rubocop/releases/tag/v0.40.0
This commit is contained in:
Noah Silas
2016-05-26 09:58:05 -07:00
committed by L. Preston Sego III
parent 8a3196d920
commit 94db09b3f6
14 changed files with 147 additions and 133 deletions

View File

@@ -15,7 +15,8 @@ module ActiveModel
@blog,
adapter: :json,
serializer: AlternateBlogSerializer,
meta: { total: 10 }).as_json
meta: { total: 10 }
).as_json
expected = {
blog: {
id: 1,
@@ -65,7 +66,8 @@ module ActiveModel
@blog,
adapter: :attributes,
serializer: AlternateBlogSerializer,
meta: { total: 10 }).as_json
meta: { total: 10 }
).as_json
expected = {
id: 1,
title: 'AMS Hints'
@@ -79,7 +81,8 @@ module ActiveModel
adapter: :json,
serializer: AlternateBlogSerializer,
meta: { total: 10 },
meta_key: 'haha_meta').as_json
meta_key: 'haha_meta'
).as_json
expected = {
blog: {
id: 1,
@@ -98,7 +101,8 @@ module ActiveModel
adapter: :json_api,
serializer: AlternateBlogSerializer,
meta: { total: 10 },
meta_key: 'haha_meta').as_json
meta_key: 'haha_meta'
).as_json
expected = {
data: {
id: '1',
@@ -148,7 +152,8 @@ module ActiveModel
actual = ActiveModelSerializers::SerializableResource.new(
[@blog],
adapter: :attributes,
meta: { total: 10 }).as_json
meta: { total: 10 }
).as_json
expected = [{
id: 1,
name: 'AMS Hints',
@@ -170,7 +175,8 @@ module ActiveModel
[@blog],
adapter: :json,
meta: { total: 10 },
meta_key: 'haha_meta').as_json
meta_key: 'haha_meta'
).as_json
expected = {
blogs: [{
id: 1,