Skip to content

Add rubocop linting for misplacement of ee only classes

Doug Stull requested to merge 378167-add-rubocop into master

Description of the proposal

Add rubocop linting for misplacement of ee only classes

        # 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

Merge request reports

Loading