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 auto-gen-config #3568

Closed
madwort opened this issue Oct 2, 2016 · 1 comment
Closed

Style/VariableNumber auto-gen-config #3568

madwort opened this issue Oct 2, 2016 · 1 comment

Comments

@madwort
Copy link
Contributor

madwort commented Oct 2, 2016

Style/VariableNumber is not disabled as expected when running rubocop --auto-gen-config on our large old codebase where both styles are used (sometimes in the same file).

Expected behavior

In this test case:

$ cat test.rb
variable_1 = 'something'
variable2 = 'something else'
$ rubocop test.rb --auto-gen-config

I would expect .rubocop_todo.yml to include:

Style/VariableNumber 
  Enabled: false

Actual behavior

It actually includes:

Style/VariableNumber
  EnforcedStyle: normalcase

Which leads to subsequent runs of rubocop failing this cop.

RuboCop version

$ rubocop -V
0.43.0 (using Parser 2.3.1.4, running on ruby 2.2.2 x86_64-linux)
@diaclavijo
Copy link

I am affected by this bug also.

jonas054 added a commit to jonas054/rubocop that referenced this issue Nov 19, 2016
When the variable name doesn't match the configured style, we should
detect which style is used so that the right information is
generated in .rubocop_todo.yml.
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

No branches or pull requests

2 participants