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

Style/VariableNumber does not allow digits in the middle #3514

Closed
eagletmt opened this issue Sep 19, 2016 · 1 comment
Closed

Style/VariableNumber does not allow digits in the middle #3514

eagletmt opened this issue Sep 19, 2016 · 1 comment
Labels

Comments

@eagletmt
Copy link
Contributor

Expected behavior

Assignments like target_u2f_device = nil isn't detected as offence against Style/VariableNumber.

Actual behavior

target_u2f_device = nil is detected.

Steps to reproduce the problem

% cat number.rb
target_u2f_device = nil
% rubocop --only Style/VariableNumber number.rb
Inspecting 1 file
C

Offenses:

number.rb:1:1: C: Style/VariableNumber: Use normalcase for variable numbers.
target_u2f_device = nil
^^^^^^^^^^^^^^^^^

1 file inspected, 1 offense detected

RuboCop version

% rubocop -V
0.43.0 (using Parser 2.3.1.3, running on ruby 2.3.1 x86_64-linux)
@parkr
Copy link

parkr commented Sep 20, 2016

Seeing the same thing.

test/test_related_posts.rb:16:7: C: Style/VariableNumber: Use normalcase for variable numbers.
      last_10_recent_posts = (@site.posts.docs.reverse - [last_post]).first(10)
      ^^^^^^^^^^^^^^^^^^^^

Reference: https://travis-ci.org/jekyll/jekyll/jobs/161430798

parkr added a commit to jekyll/jekyll that referenced this issue Sep 20, 2016
b-t-g pushed a commit to b-t-g/rubocop that referenced this issue Sep 22, 2016
kyrylo added a commit to airbrake/airbrake-ruby that referenced this issue Sep 23, 2016
b-t-g pushed a commit to b-t-g/rubocop that referenced this issue Sep 24, 2016
…fines normal case by allowing numbers after the first underscore.
kyrylo added a commit to airbrake/airbrake-ruby that referenced this issue Sep 28, 2016
mikezter added a commit to mikezter/rubocop that referenced this issue Sep 28, 2016
* bbatsov/master: (80 commits)
  [Fix rubocop#3540] Make `Style/GuardClause` register offense for instance & singleton methods
  [Fix rubocop#3436] issue related to Rails/SaveBang when returning non-bang call from the parent method
  Allow `#to_yml` to produce single-quoted strings
  Add support for StyleGuideBaseURL and update rules
  Add spec for the existing style guide URL implementation
  Fix the changelog
  Edited regular expression for normal case to fix issues rubocop#3514 and rubocop#3516 (rubocop#3524)
  Add a rake task for generation a new cop (rubocop#3533)
  [Fix rubocop#3510] Various bug fixes for SafeNavigation (rubocop#3517)
  [Fix rubocop#3512] Change error message of `Lint/UnneededSplatExpansion` for array (rubocop#3526)
  Fix false positive in `Lint/AssignmentInCondition` (rubocop#3520) (rubocop#3529)
  Rename a mismatched filename (rubocop#3523)
  Fix a broken changelog entry
  [Fix rubocop#3511] Style/TernaryParentheses false positive (rubocop#3513)
  Fix the release notes for 0.43
  Cut 0.43.0
  [Fix rubocop#3462] Don't flag single-line methods
  Fix false negatives in `Rails/NotNullColumn` cop (rubocop#3508)
  Remove unused doubled methods (rubocop#3509)
  [Fix rubocop#3485] Make OneLineConditional cop ignore empty else (rubocop#3487)
  ...
Neodelf pushed a commit to Neodelf/rubocop that referenced this issue Oct 15, 2016
…and rubocop#3516 (rubocop#3524)

[Fix rubocop#3514][Fix rubocop#3516] Edit regular expression which defines normal case by allowing numbers after the first underscore.

This also fixes the normal case analog to issue rubocop#3519 - changed and simplified normal case definition to allow multi-digit numbers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants