2019-11-28 13:06:11 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-07-23 14:10:06 -04:00
|
|
|
require_relative '../routes_under_scope'
|
|
|
|
|
2019-11-28 13:06:11 -05:00
|
|
|
module RuboCop
|
|
|
|
module Cop
|
|
|
|
# Checks for a project routes outside '/-/' scope.
|
|
|
|
# For more information see: https://gitlab.com/gitlab-org/gitlab/issues/29572
|
2022-09-14 11:12:56 -04:00
|
|
|
class PutProjectRoutesUnderScope < RuboCop::Cop::Base
|
2020-07-23 14:10:06 -04:00
|
|
|
include RoutesUnderScope
|
|
|
|
|
2019-11-28 13:06:11 -05:00
|
|
|
MSG = 'Put new project routes under /-/ scope'
|
|
|
|
|
|
|
|
def_node_matcher :dash_scope?, <<~PATTERN
|
|
|
|
(:send nil? :scope (:str "-"))
|
|
|
|
PATTERN
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|