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

Do all the remaining TODOs #74

Merged
merged 10 commits into from May 18, 2020
Merged

Do all the remaining TODOs #74

merged 10 commits into from May 18, 2020

Conversation

benthorner
Copy link
Contributor

Closes: #42

Please see the commits for more details.

Ben Thorner added 10 commits May 15, 2020 14:21
We should be able to use groups to avoid issues with this Cop, and
otherwise disable it in the specific repos that have unresolvable
issues with it.
This conflicts with  our predominant use of has_many (300), vs.
has_and_belongs_to_many (15). Although this Cop doesn't support
auto-correction, it should be practical to fix the 15 issues
manually - it's possible some of them aren't even necessary!
This still causes issues in some of our repos, where developers have
put output statements in DB migrations. Since a human is unlikely to
see the result of this output, we should go ahead and disallow this,
and manually resolve silence the issue for historical files, by using
a comment in the file itself (to avoid setting a precedent).
Testing against a number of apps only shows major issues in Whitehall,
for which a simple substitution command should suffice. If necessary,
we can always pass 'validate: false' to explicitly disable validations.

Tested against:

- Content Publisher
- Whitehall
- Search API
- Email Alert API
This is an analog of Style/GuardClause, which we have enabled.
We should use the online docs instead, which are up-to-date.
Copy link

@richardTowers richardTowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Shame that SkipsModelValidations still uses the Blacklist terminology, but we don't necessarily need to shave that yak here.

@benthorner
Copy link
Contributor Author

@richardTowers thanks for reviewing - I hesitated with the Blacklist, but it seemed a bit extreme to avoid using the Cop because of the terminology it uses.

@benthorner benthorner merged commit 5083f8d into master May 18, 2020
@benthorner benthorner deleted the final-push branch May 18, 2020 09:06
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

Successfully merging this pull request may close these issues.

Lots of Cops are switched off with no explanation
2 participants