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
Better separation of concerns between Team and Commissioner #8030
Conversation
Argh, this is all good but the spec_helper needs to be fixed. It also shows it was duplicating the finding the forces. It should create a Team, not a Commissionner, but then this shows that |
Congrats to Metrics/AbcSize thinking this code is more complicated than before
Before this commit: * a second call to `Commissioner#investigate` could be missing a cop that was excluded previously * a force might be added by Team for a single cop that is later judged to be non relevant by Commissioner but the later can't exclude the force now * cops judged not relevant by the Commissioner were still processed (e.g. in autocorrect_all_cops)
I refactored I feel that's the cleanest API, but it would be easy for |
Compatibility with what? :-) I think this class is not used outside the main gem. I did a quick grep in some extensions and I don't see any usages. |
Btw, this might also be a good opportunity to actually document the responsibilities of the class - I see currently they are "FIXME". :D |
Cool. I'll add a short doc and a Changelog entry |
Now we know that the answer is, at least, |
So we do. :-) |
Use `Rubocop::Cop::Team#mobilize` instead of `Rubocop::Cop::Team.new` if RuboCop version is 0.85.0 and later because RuboCop changed `Team` API at v0.85.0. ref. rubocop/rubocop#8030
Use `Rubocop::Cop::Team#mobilize` instead of `Rubocop::Cop::Team.new` if RuboCop version is 0.85.0 and later because RuboCop changed `Team` API at v0.85.0. ref. rubocop/rubocop#8030
Excluding non-relevant cops is a duty of
Team
, notCommissioner
.Before this PR:
Commissioner#investigate
could be missing a cop that was excluded previouslyCommissioner
but the later can't exclude the force nowCommissioner
were still looped through (e.g. inautocorrect_all_cops
)PR also includes some code cleanup. This is a prelude to #7968