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

[Fix #8726] Fix a false positive for Naming/VariableNumber #8727

Merged

Conversation

koic
Copy link
Member

@koic koic commented Sep 16, 2020

Fixes #8726.

Fix a false positive for Naming/VariableNumber when naming multibyte character variable name.


Before submitting the PR make sure the following are checked:

  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

Fixes rubocop#8726.

Fix a false positive for `Naming/VariableNumber`
when naming multibyte character variable name.
@koic koic force-pushed the fix_false_positive_for_naming_variable_number branch from e8a7bf3 to 0529b17 Compare September 16, 2020 06:58
@bbatsov bbatsov merged commit a6c89f9 into rubocop:master Sep 16, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 16, 2020

Thanks!

@koic koic deleted the fix_false_positive_for_naming_variable_number branch September 16, 2020 07:24
@@ -98,6 +99,7 @@ def method(funnyArg1); end
it_behaves_like 'accepts', 'normalcase', '_foo'
it_behaves_like 'accepts', 'normalcase', '@foo'
it_behaves_like 'accepts', 'normalcase', '@__foo__'
it_behaves_like 'accepts', 'snake_case', 'emparejó'
Copy link
Member

Choose a reason for hiding this comment

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

Should this have been normalcase instead of snake_case?

@@ -139,6 +141,7 @@ def method(funnyArg_1); end
it_behaves_like 'accepts', 'non_integer', '_'
it_behaves_like 'accepts', 'non_integer', '_foo'
it_behaves_like 'accepts', 'non_integer', '@__foo__'
it_behaves_like 'accepts', 'snake_case', 'emparejó'
Copy link
Member

Choose a reason for hiding this comment

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

Same thing here.

koic added a commit to koic/rubocop that referenced this pull request Nov 13, 2020
Follow rubocop#8727 (comment)

This PR corrects two test cases for `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 this pull request may close these issues.

Naming/VariableNumber False positive detection with non ascii chars
3 participants