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

Naming/VariableNumber reporting on stdlib call #9104

Closed
mmainz opened this issue Nov 26, 2020 · 0 comments · Fixed by #9106
Closed

Naming/VariableNumber reporting on stdlib call #9104

mmainz opened this issue Nov 26, 2020 · 0 comments · Fixed by #9106

Comments

@mmainz
Copy link

mmainz commented Nov 26, 2020

I have the following code:

        if serialized_value.respond_to?(:iso8601)

Expected behavior

I'd expect this to not yield an offense. The method is called iso8601 and I am not able to change that, since the Time class is from the standard lib. So I have no way of fixing the issue. And I don't want to litter my code with comments to disable Rubocop every time this is done.

Actual behavior

Inspecting 85 files
...............................C.....................................................
Offenses:
lib/serializers/merged_queue_serializer.rb:25:41: C: Naming/VariableNumber: Use snake_case for symbol numbers.
        if serialized_value.respond_to?(:iso8601)
                                        ^^^^^^^^
85 files inspected, 1 offense detected

RuboCop version

1.4.2 (using Parser 2.7.2.0, rubocop-ast 1.2.0, running on ruby 2.7.2 x86_64-darwin19)
  - rubocop-rspec 2.0.0
koic added a commit to koic/rubocop that referenced this issue Nov 26, 2020
…leNumber`

Fixes rubocop#9104

This PR presets some stdlib method names for `AllowedIdentifiers` of
`Naming/VariableNumber`.
bbatsov pushed a commit that referenced this issue Nov 26, 2020
Fixes #9104

This PR presets some stdlib method names for `AllowedIdentifiers` of
`Naming/VariableNumber`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant