Commit graph

2 commits

Author SHA1 Message Date
Yorick Peterse
9722158c15
Fix detecting nested EE constants in RuboCop
The InjectEnterpriseEditionModule cop would not detect certain nested EE
constants such as `EE::Foo::Bar::Baz`. This could result in it not
enforcing `prepend` being placed on the last line. This commit fixes
this by just performing a string match on the line, instead of relying
on AST matching.
2019-01-16 16:48:18 +01:00
Yorick Peterse
7c58055631
Added Cop for injecting EE modules
This Cop enforces the rule that injecting EE modules (using prepend,
include, or extend) is done by placing the injection on the last line of
a file, instead of somewhere in the middle. By placing these lines at
the very end, merge conflicts will not happen.
2018-12-13 16:09:21 +01:00