Is your feature request related to a problem? Please describe.
Currently, many rubocop cops are disabled (see .rubocop.yml), I think it would be beneficial to enable most of them. In such a way at least the new code will follow the guidelines.
Describe the solution you'd like
I like the way how we dealt with the views linting problems (#1842)
The similar approach is possible for the ruby code & the rubocop
The workflow I suggest:
.rubocop.yml.rubocop_todo.yml (there're already some examples)For some cops, there are no violations in the code, so they could just be enabled.
I can prepare a list of cops to enable if this issue gets approved.
Can I work on this issue?
Also interested!
@keshavbiswa @JoppeDC you're welcome.
I'll be posting lists of the cops you can work on.
I suppose there're no violations to these cops, so they can just be enabled:
[x] Lint/Void
Please, notify about the cops you're working on in this thread.
If you have any problems or questions, feel free to ask them in this thread or in your (draft) pull request.
Okay sure thanks :)
Hello, I would like to participate too.
Is it too late to do the Performance cops ?
I believe not, go for it!
Thanks, I 'll handle it so.
Havent gotten to it yet. So go ahead :)
On Wed, 20 Mar 2019 at 17:07, cyrillefr notifications@github.com wrote:
Thanks, I 'll handle it so.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/thepracticaldev/dev.to/issues/2021#issuecomment-474904797,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJRe5DuV0L2JcW50FsH3dJ_sHK_Af2AHks5vYlzDgaJpZM4boGAy
.
@cyrillefr Go for it! I will work on Layout Cops :smile:
Will work on the Lint ones
Cops left to be fixed (from the rubocop_todo):
I think these cops should be enabled + exclude files that contain violations + configure max values where applicable:
Hello,
I would like to take care of the first group of cops(rubocop_todo).
But before proceeding, I would like to put what I intend to do:
Rails/HasManyOrHasOneDependent
|→ 28 offenses for not specifying a :dependent option. To discard these offenses, I can add a :dependent :nullify(default value for :dependent).
Rails/SkipsModelValidations
|→ 45 offenses on spec files because update_column skips validation. I can change to update.
|→ 104 offenses on other files
Layout: 177 offenses: I can fix with the automatic fix option of rubocop.
NB: I may be behind a few commits, so the number might be a little bit inaccurate, but of same order.
I did not ran any tests, so I have got no idea of new errors that may arise from these changes.
So, tell me if I may proceed this way.
Hey @cyrillefr
I revised the cops list, and think that I should first discuss enabling and fixing Rails/HasManyOrHasOneDependent with the team.
As for the Rails/SkipsModelValidations now I think it shouldn't be enabled. Running some validations need running SQL-queries which will affect performance. update_all and update_column are fine if we use them consciously.
Fixing Layout cops should be straightforward, so feel free to fix them.
I made small updates to the config.
For now:
Rails/HasManyOrHasOneDependent should be safe to be enabled, :dependent should be set to :nullify (as @cyrillefr suggested). I suggest making a separate pr for this fix.Layout/InitialIndentation is still available to be fixed