Add rubocop linting for misplacement of ee only classes
Description of the proposal
Add rubocop linting for misplacement of ee only classes
- placing an ee only class under an ee/**/ee subdirectory is not the right placement and we should alert on it.
- see https://docs.gitlab.com/ee/development/ee_features.html#extend-ce-features-with-ee-backend-code
- see #378167 (closed)
# Cop that checks for incorrect placement of classes in the ee/**/ee subdirectories.
#
# see https://docs.gitlab.com/ee/development/ee_features.html#extend-ce-features-with-ee-backend-code
#
# # bad
# # filename: ee/app/services/ee/null_notification_service.rb
# module EE
# class NullNotificationService
# end
# end
#
# # good
# # filename: ee/app/services/null_notification_service.rb
# class NullNotificationService
# end
#
Check-list
-
Make sure this MR enables a static analysis check rule for new usage but ignores current offenses. -
Create a follow-up issue to fix the current offenses as a separate iteration: #488501 -
Follow the review process as usual. -
Once approved and merged by a maintainer, mention it again: -
In the relevant Slack channels (e.g. #development
,#backend
,#frontend
). -
In the Engineering Week in Review.
-
Edited by Doug Stull