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

Rubocop 0.80.0 outputs warnings about newly introduced cops #7731

Closed
tagliala opened this issue Feb 19, 2020 · 10 comments
Closed

Rubocop 0.80.0 outputs warnings about newly introduced cops #7731

tagliala opened this issue Feb 19, 2020 · 10 comments

Comments

@tagliala
Copy link
Contributor

When providing a configuration file to Rubocop 0.80.0, I see three warnings related to

  • Style/HashEachMethods
  • Style/HashTransformKeys
  • Style/HashTransformValues

Does not happen with RuboCop 0.79.0

I'm testing the current master branch


Expected behavior

Do not see warnings

Actual behavior

$ rubocop -V
0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin19)
$ rubocop
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
 - Style/HashEachMethods
 - Style/HashTransformKeys
 - Style/HashTransformValues

Steps to reproduce the problem

$ touch test.rb
$ touch .rubocop.yml
$ rubocop

RuboCop version

0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin19)

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler. Here's an example:

$ [bundle exec] rubocop -V
0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin19)
@ShockwaveNN
Copy link
Contributor

Also this broke overcommit integration

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 19, 2020

That's a feature. :-) As many users were complaining that when new cops were introduced this caused CI failures and extra code fixing work, we decided to just list the new cops that were added and leave it to the users to enable/disable them.

Note that those are not warnings - just informative messages.

@bbatsov bbatsov closed this as completed Feb 19, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Feb 19, 2020

See #7567 and #5979 for more details.

@ShockwaveNN
Copy link
Contributor

But I don't think broken overcommit integration is look like a feature, or is this better to discuss with overcommit team?

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 19, 2020

But I don't think broken overcommit integration is look like a feature

I was referring to the description of the issue.

or is this better to discuss with overcommit team?

I think that'd be best. I'm sorry to hear the change caused a breakage, but I've never used the tool, so I'm not sure what this integration looks like. We're always willing to help 3rd party tools that want to leverage RuboCop.

@ShockwaveNN
Copy link
Contributor

@bbatsov Ok, thanks. Created an issue at overcommit - sds/overcommit#704

@tagliala
Copy link
Contributor Author

That's a feature. :-) As many users were complaining that when new cops were introduced this caused CI failures and extra code fixing work, we decided to just list the new cops that were added and leave it to the users to enable/disable them.

Hi @bbatsov , thanks for the clarification!

So every new cop will have "Enabled: pending" and we should decide if we want them or not in our own rubocop.yml?

@bbatsov
Copy link
Collaborator

bbatsov commented Feb 19, 2020

Yes. RuboCop will update the pending status to enabled/disable only for major releases (similar to what ESLint does).

We'll likely cut RuboCop 1.0 is the next couple of months.

louim added a commit to hooktstudios/rubocop-hookt that referenced this issue Feb 24, 2020
Rubocop will not enable new "default" cops until major releases now.
rubocop/rubocop#7731
@tagliala
Copy link
Contributor Author

tagliala commented Feb 28, 2020

@bbatsov is there any command line options to enable by default the newly introduced cops?

Use case:

  • I have a folder with just a ruby file
  • I run rubocop -a
  • I want all cops to be run against the file in the folder, without having to create a .rubocop.yml file

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

3 participants