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

Add Rubocop #1124

Closed
MaicolBen opened this issue Mar 22, 2018 · 8 comments
Closed

Add Rubocop #1124

MaicolBen opened this issue Mar 22, 2018 · 8 comments

Comments

@MaicolBen
Copy link
Collaborator

This will improve remarkably the quality of the repo, but currently, there are 2563 issues on rubocop, so it will take a while, this can be done by parts (folders or whatever group of files).

@zachfeldman
Copy link
Contributor

That would be a great enhancement

@lynndylanhurley
Copy link
Owner

Agreed - this will be a huge help.

@Evan-M
Copy link
Collaborator

Evan-M commented Mar 23, 2018

While it seems daunting, the top offenses are:

1487  Style/StringLiterals
329   Metrics/LineLength
130   Style/FrozenStringLiteralComment
127   Style/HashSyntax
94    Metrics/BlockLength

and the worst offenders are:

1038  test/dummy/app/helpers/application_helper.rb
325   test/dummy/db/schema.rb
85    app/models/devise_token_auth/concerns/user.rb
73    lib/devise_token_auth/rails/routes.rb
69    lib/generators/devise_token_auth/install_generator.rb

So simply ignoring the code in the test/dummy Rails app cuts the offenses down to under 1000!

@MaicolBen
Copy link
Collaborator Author

There is a plugin in atom that fixes automatically by file, I don't know if it can be done in the command line. The only downside of this is that all the PRs will have conflicts, but this should be done sometime.

@Evan-M
Copy link
Collaborator

Evan-M commented Mar 23, 2018

There is definitely a builtin --autocorrect option, that can even be enabled for specific cops only
https://rubocop.readthedocs.io/en/latest/configuration/#autocorrect

It might not create as many conflicts as you think... the autocorrect opotion on Style/StringLiterals cop might be useful.

@Evan-M Evan-M mentioned this issue Mar 24, 2018
@dks17
Copy link
Contributor

dks17 commented Mar 25, 2018

Consider also guard-rubocop gem.

gem 'rubocop', require: false
gem 'guard-rubocop'

@dks17 dks17 mentioned this issue Mar 25, 2018
@dks17 dks17 mentioned this issue Apr 2, 2018
@dks17
Copy link
Contributor

dks17 commented Jul 3, 2018

@MaicolBen Hello. We added many changes to realize this enhancement. We didn't cover it totally, but most. I think future work should be carried on as usual for pull requests.
Should the issue be closed?

@MaicolBen
Copy link
Collaborator Author

agreed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants