Skip to content
代码片段 群组 项目
提交 d9b21d24 编辑于 作者: John Mason's avatar John Mason
浏览文件

Update Search/NamespacedClass cop

Changelog: changed
EE: true
上级 d6725e92
No related branches found
No related tags found
无相关合并请求
......@@ -3,7 +3,7 @@
module API
module Admin
module Search
class Zoekt < ::API::Base # rubocop:disable Search/NamespacedClass
class Zoekt < ::API::Base
MAX_RESULTS = 20
feature_category :global_search
......
......@@ -3,20 +3,20 @@
module API
module Entities
module Search
module Zoekt # rubocop:disable Search/NamespacedClass
class IndexedNamespace < Grape::Entity # rubocop:disable Search/NamespacedClass
module Zoekt
class IndexedNamespace < Grape::Entity
expose :id, documentation: { type: :int, example: 1234 }
expose :zoekt_shard_id, documentation: { type: :int, example: 1234 }
expose :namespace_id, documentation: { type: :int, example: 1234 }
end
class Shard < Grape::Entity # rubocop:disable Search/NamespacedClass
class Shard < Grape::Entity
expose :id, documentation: { type: :int, example: 1234 }
expose :index_base_url, documentation: { type: :string, example: 'http://127.0.0.1:6060/' }
expose :search_base_url, documentation: { type: :string, example: 'http://127.0.0.1:6070/' }
end
class ProjectIndexSuccess < Grape::Entity # rubocop:disable Search/NamespacedClass
class ProjectIndexSuccess < Grape::Entity
expose :job_id do |item|
item[:job_id]
end
......
......@@ -20,8 +20,10 @@ class NamespacedClass < RuboCop::Cop::Base
# These namespaces are considered acceptable.
# Note: Nested namespace like Foo::Bar are also supported.
PERMITTED_NAMESPACES = %w[Search EE::Search API::Search EE::API::Search RuboCop::Cop::Search]
.map { |x| x.split('::') }.freeze
PERMITTED_NAMESPACES = %w[
Search EE::Search API::Search EE::API::Search API::Admin::Search RuboCop::Cop::Search
API::Entities::Search::Zoekt
].map { |x| x.split('::') }.freeze
SEARCH_REGEXES = [
/elastic/i,
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册