Catch more offenses in Cop/StaticTranslationDefinition
What does this MR do and why?
This MR improves this cop rule to catch more translation definitions in static scope.
The new implementation has a more pessimistic approach and only considers certain cases to be allowed.
The following cases are now banned:
class Record
validates :foo, message: _('An error')
included do # or prepended or class_methods
self.error_message = _('Something went wrong.')
end
end
This
Closes #348693 (closed).
Refs !89833 (comment 985700149)
How to set up and validate locally
bundle exec rubocop --only Cop/StaticTranslationDefinition
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Peter Leitzen