2039c8280d
This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
25 lines
616 B
Ruby
25 lines
616 B
Ruby
module Gitlab
|
|
module SlashCommands
|
|
class IssueSearch < IssueCommand
|
|
def self.match(text)
|
|
/\Aissue\s+search\s+(?<query>.*)/.match(text)
|
|
end
|
|
|
|
def self.help_message
|
|
"issue search <your query>"
|
|
end
|
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
def execute(match)
|
|
issues = collection.search(match[:query]).limit(QUERY_LIMIT)
|
|
|
|
if issues.present?
|
|
Presenters::IssueSearch.new(issues).present
|
|
else
|
|
Presenters::Access.new(issues).not_found
|
|
end
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
end
|
|
end
|
|
end
|