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

False positive Naming/BinaryOperatorParameterName detection #8664

Closed
ldebortoli opened this issue Sep 8, 2020 · 0 comments · Fixed by #8665
Closed

False positive Naming/BinaryOperatorParameterName detection #8664

ldebortoli opened this issue Sep 8, 2020 · 0 comments · Fixed by #8665
Labels

Comments

@ldebortoli
Copy link

Naming/BinaryOperatorParameterName detected in a method that is not a binary operator

módulos/última_vez.rb:43:31: C: Naming/BinaryOperatorParameterName: When defining the última_vez_supergrupo operator, name its argument other.
    def última_vez_supergrupo(msj)
                              ^^^

última_vez_supergrupo is not an operator, just a regular method

    # Cuando un grupo cambia a supergrupo
    def última_vez_supergrupo(msj)
        # Esta función está definida en dankie.rb
        cambiar_claves_supergrupo(msj.migrate_from_chat_id,
                                  msj.chat.id,
                                  'último_mensaje:')
    end

Expected behavior

Any detection

Actual behavior

A false positive detection

Steps to reproduce the problem

Create a method that its name is última_vez_supergrupo

RuboCop version

$ [bundle exec] rubocop -V
0.90.0 (using Parser 2.7.1.4, rubocop-ast 0.3.0, running on ruby 2.6.6 x86_64-linux)
@koic koic added the bug label Sep 8, 2020
koic added a commit to koic/rubocop that referenced this issue Sep 8, 2020
…ameterName`

Fixes rubocop#8664.

This PR fixes a false positive for `Naming/BinaryOperatorParameterName`
when naming multibyte character method name.
bbatsov pushed a commit that referenced this issue Sep 8, 2020
…ame`

Fixes #8664.

This PR fixes a false positive for `Naming/BinaryOperatorParameterName`
when naming multibyte character method name.
jmkoni pushed a commit to standardrb/standard that referenced this issue Sep 16, 2020
…en fixed

* Update Rubocop from
  [0.90](https://github.com/rubocop-hq/rubocop/releases/tag/v0.90.0)
  to
  [0.91](https://github.com/rubocop-hq/rubocop/releases/tag/v0.91.0),
  enabling:
  * [`Lint/UselessTimes`](rubocop/rubocop#8702)
  * [`Layout/BeginEndAlignment`](rubocop/rubocop#8628)
  * [`Lint/ConstantDefinitionInBlock`](rubocop/rubocop#8707)
  * [`Lint/IdentityComparison`](rubocop/rubocop#8699)
  re-enabling after bug fixes:
  * [`Bundler/DuplicatedGem`](rubocop/rubocop#8666)
  * [`Naming/BinaryOperatorParameterName`](rubocop/rubocop#8664)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants