You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your work, it's all much appreciated. I have a question on whether something is possible.
Is there a way to get the list of cops that are currently disabled but have 0 violations?
This seems like something that should be doable, but I can't find how to do it.
It doesn't need to be an available command, but maybe if I can get some pointers of how to put together a script or something that could get me the answer.
I know we have RuboCop::Cop::Registry that seems to be where I should look, but I'm not sure how to use it.
we can use RuboCop::Cop::Registry.all or RuboCop::Cop::Registry.global to get the list of cops.
we also have enabled?/disabled? as methods in that class, but I don't know what the param config should be.
but then if I got the list of disabled cops, how to figure out which ones have 0 violations?
if you're wondering why I'm asking: we're adding rubocop to a giant (~400k loc) repo and I want to try to enable the ones that have 0 violations first in one go, and then address the other ones one by one. And currently, for reasons outside of my control, rubocop is configured to have all cops disabled by default, and then we have to enable them one by one. So I can't just enable everything and generate ad .todo file for the ones that do have a violation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thank you for your work, it's all much appreciated. I have a question on whether something is possible.
Is there a way to get the list of cops that are currently disabled but have 0 violations?
This seems like something that should be doable, but I can't find how to do it.
It doesn't need to be an available command, but maybe if I can get some pointers of how to put together a script or something that could get me the answer.
I know we have
RuboCop::Cop::Registry
that seems to be where I should look, but I'm not sure how to use it.we can use
RuboCop::Cop::Registry.all
orRuboCop::Cop::Registry.global
to get the list of cops.we also have
enabled?/disabled?
as methods in that class, but I don't know what the paramconfig
should be.but then if I got the list of disabled cops, how to figure out which ones have 0 violations?
if you're wondering why I'm asking: we're adding rubocop to a giant (~400k loc) repo and I want to try to enable the ones that have 0 violations first in one go, and then address the other ones one by one. And currently, for reasons outside of my control, rubocop is configured to have all cops disabled by default, and then we have to enable them one by one. So I can't just enable everything and generate ad
.todo
file for the ones that do have a violation.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions