Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update rubocop #1560

Merged
merged 5 commits into from
Mar 8, 2016
Merged

Update rubocop #1560

merged 5 commits into from
Mar 8, 2016

Conversation

groyoh
Copy link
Member

@groyoh groyoh commented Mar 7, 2016

Purpose

Rebase #1498

Related GitHub issues

Closes #1498

Additional helpful information

@bf4 @remear here you go 😄 Just need to update the trailling/leading dot and add a CHANGELOG. Anything else missing?

@@ -1,7 +1,7 @@
module ActiveModelSerializers
module Adapter
UnknownAdapterError = Class.new(ArgumentError)
ADAPTER_MAP = {}
ADAPTER_MAP = {} # rubocop:disable Style/MutableConstant
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubocop changed this to:

ADAPTER_MAP = {}.freeze

which prevent us to modify the hash at line 52 and thus breaks the gem/tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

@bf4
Copy link
Member

bf4 commented Mar 7, 2016

test/action_controller/serialization_test.rb:435:7: W: Lint/UnneededDisable: Unnecessary disabling of Lint/DuplicateMethods.
      # rubocop:disable Lint/DuplicateMethods
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
148 files inspected, 1 offense detected

womp wmp

@groyoh
Copy link
Member Author

groyoh commented Mar 7, 2016

Weird, rubocop is green locally 😕

@groyoh
Copy link
Member Author

groyoh commented Mar 7, 2016

Ah found it, it was 0.37 locally but 0.37.2 on Travis.

@groyoh
Copy link
Member Author

groyoh commented Mar 7, 2016

@bf4 What do you think about pinning the rubocop version?

@bf4
Copy link
Member

bf4 commented Mar 7, 2016

Depends if it's broken and causing trouble or just different

B mobile phone

On Mar 7, 2016, at 5:28 PM, Yohan Robert [email protected] wrote:

@bf4 What do you think about pinning the rubocop version?


Reply to this email directly or view it on GitHub.

@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

I assume new cops are added every few versions so if the version is not fixed, then we might run into new cops every now and then, making the build fail.

Enabled: false

Style/DotPosition:
EnforcedStyle: trailing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @remear I tend to prefer leading here. what about you @bf4?

groyoh pushed a commit to groyoh/active_model_serializers that referenced this pull request Mar 8, 2016
groyoh pushed a commit to groyoh/active_model_serializers that referenced this pull request Mar 8, 2016
groyoh pushed a commit to groyoh/active_model_serializers that referenced this pull request Mar 8, 2016
@NullVoxPopuli
Copy link
Contributor

needs rebase -- as long as the checks pass, I'm good with merging.

EnforcedStyle: semantic

Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: consistent_comma
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the trailing comma what all the cool kids do these days? https://github.com/rails-api/active_model_serializers/pull/1560/files#diff-57dc91570125bb0a036a83a5c8bd6be8R63

Usually I'm fine with it being allowed, not necessarily required, as is a habit I picked up from Python for this. I'm curious if others have any strong opinion here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally not a fan of the trailing comma. But I guess if that's what the standard is now a days...

@NullVoxPopuli NullVoxPopuli mentioned this pull request Mar 8, 2016
@remear
Copy link
Member

remear commented Mar 8, 2016

Sounds like the team prefers the DotPosition before, e.g.,

SomeClass.awesome_sauce
 .do_things

The team also prefers to not enforce a trailing comma.

@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

Rebased and updated with the style fix.

@remear
Copy link
Member

remear commented Mar 8, 2016

👍

@NullVoxPopuli
Copy link
Contributor

I'm good with this.

@NullVoxPopuli
Copy link
Contributor

do we want to merge anything before we merge this, as it could cause conflicts in other PRs?

@groyoh
Copy link
Member Author

groyoh commented Mar 8, 2016

@NullVoxPopuli good point here. IMO, it would be easier to merge this first and update the other PR as this one is pretty big.

NullVoxPopuli added a commit that referenced this pull request Mar 8, 2016
@NullVoxPopuli NullVoxPopuli merged commit f8d2aab into rails-api:master Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants