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
Enable Rails related Rubocop rules #9234
Enable Rails related Rubocop rules #9234
Conversation
9a4cd75
to
f79df48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed one potential issue below but I also think it's outside of the scope for this PR.
I also noticed you left Rails/I18nLocaleTexts
enabled, is it on purpose?
Lines 49 to 50 in 2068f4a
Rails/I18nLocaleTexts: | |
Enabled: false |
The only violation from that seems to be here:
validates :voting_type, presence: true, inclusion: { in: Votings::Voting.voting_types, message: "%{value} is not a valid voting type" } |
Can we fix that too?
Yes, it was left on purpose as that translation key may be tricky ( i do not have a working election test suite on my local ). |
2068f4a
to
a9b91fd
Compare
@ahukkanen , the requested violation has been fixed in 223f0cd |
@ahukkanen , can you have a look on this, so we can minimize the rubocop issues ? I am waiting for this to be merged, so I can unlock #9272 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alecslupu, it looks good now.
There's still the dependent: :destroy
thing I mentioned but I think that's a wider problem in Decidim and I don't think it's very common case.
Could you please remove this comment from the disabled rules:
Lines 22 to 23 in 223f0cd
#Rails/I18nLocaleTexts: | |
# Enabled: false |
After that it's good to go for me.
The commented code removed in 463aff2 |
Yep, I created a separate issue #9291 to track that. |
* Fix Rails/DuplicateScope * Fix Rails/DurationArithmetic * Fix Rails/CompactBlank * Fix Rails/EagerEvaluationLogMessage * Fix Rails/RedundantPresenceValidationOnBelongsTo * Fix Rails/ExpandedDateRange * Fix Rails/TransactionExitStatement * Fixing Validators * Fix Rails/HasManyOrHasOneDependent * Clean up .rubocop-disabled.yml * Clean up the rubocop-disabled file * Fix Rails/I18nLocaleTexts * Remove commented code
* Fix Rails/DuplicateScope * Fix Rails/DurationArithmetic * Fix Rails/CompactBlank * Fix Rails/EagerEvaluationLogMessage * Fix Rails/RedundantPresenceValidationOnBelongsTo * Fix Rails/ExpandedDateRange * Fix Rails/TransactionExitStatement * Fixing Validators * Fix Rails/HasManyOrHasOneDependent * Clean up .rubocop-disabled.yml * Clean up the rubocop-disabled file * Fix Rails/I18nLocaleTexts * Remove commented code
π© What? Why?
Please describe your pull request.
π Related Issues
Link your PR to an issue
Testing
Describe the best way to test or validate your PR.
π Checklist
π¨ Please review the guidelines for contributing to this repository.
docs/
.π· Screenshots
Please add screenshots of the changes you're proposing