diff options
author | gfyoung <gfyoung17@gmail.com> | 2018-11-19 18:01:13 -0800 |
---|---|---|
committer | gfyoung <gfyoung17@gmail.com> | 2018-11-19 18:24:22 -0800 |
commit | f93f8f569d51cdc738d1653a264a762b2c08fde0 (patch) | |
tree | 63883b10e0e618b730bc2859a62ce840611846e0 /lib/gitlab/slash_commands | |
parent | 60261d9d3cbad16f9846b01c994e7575430184d9 (diff) | |
download | gitlab-ce-f93f8f569d51cdc738d1653a264a762b2c08fde0.tar.gz |
Enable even more frozen string for lib/gitlab
Enables frozen string for the following:
* lib/gitlab/patch/**/*.rb
* lib/gitlab/popen/**/*.rb
* lib/gitlab/profiler/**/*.rb
* lib/gitlab/project_authorizations/**/*.rb
* lib/gitlab/prometheus/**/*.rb
* lib/gitlab/query_limiting/**/*.rb
* lib/gitlab/quick_actions/**/*.rb
* lib/gitlab/redis/**/*.rb
* lib/gitlab/request_profiler/**/*.rb
* lib/gitlab/search/**/*.rb
* lib/gitlab/sherlock/**/*.rb
* lib/gitlab/sidekiq_middleware/**/*.rb
* lib/gitlab/slash_commands/**/*.rb
* lib/gitlab/sql/**/*.rb
* lib/gitlab/template/**/*.rb
* lib/gitlab/testing/**/*.rb
* lib/gitlab/utils/**/*.rb
* lib/gitlab/webpack/**/*.rb
Partially addresses gitlab-org/gitlab-ce#47424.
Diffstat (limited to 'lib/gitlab/slash_commands')
19 files changed, 43 insertions, 4 deletions
diff --git a/lib/gitlab/slash_commands/base_command.rb b/lib/gitlab/slash_commands/base_command.rb index 0c76378d51c..fcc120112f2 100644 --- a/lib/gitlab/slash_commands/base_command.rb +++ b/lib/gitlab/slash_commands/base_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class BaseCommand diff --git a/lib/gitlab/slash_commands/command.rb b/lib/gitlab/slash_commands/command.rb index c82320a6036..474c09b9c4d 100644 --- a/lib/gitlab/slash_commands/command.rb +++ b/lib/gitlab/slash_commands/command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class Command < BaseCommand diff --git a/lib/gitlab/slash_commands/deploy.rb b/lib/gitlab/slash_commands/deploy.rb index b308fd9637f..157d924f99f 100644 --- a/lib/gitlab/slash_commands/deploy.rb +++ b/lib/gitlab/slash_commands/deploy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class Deploy < BaseCommand diff --git a/lib/gitlab/slash_commands/help.rb b/lib/gitlab/slash_commands/help.rb index 81f3707e03e..dbe15baa3d7 100644 --- a/lib/gitlab/slash_commands/help.rb +++ b/lib/gitlab/slash_commands/help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class Help < BaseCommand diff --git a/lib/gitlab/slash_commands/issue_command.rb b/lib/gitlab/slash_commands/issue_command.rb index 3d96982b820..4c8dc4b1784 100644 --- a/lib/gitlab/slash_commands/issue_command.rb +++ b/lib/gitlab/slash_commands/issue_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class IssueCommand < BaseCommand diff --git a/lib/gitlab/slash_commands/issue_move.rb b/lib/gitlab/slash_commands/issue_move.rb index 3985e635983..d2f1f130b38 100644 --- a/lib/gitlab/slash_commands/issue_move.rb +++ b/lib/gitlab/slash_commands/issue_move.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class IssueMove < IssueCommand diff --git a/lib/gitlab/slash_commands/issue_new.rb b/lib/gitlab/slash_commands/issue_new.rb index 6396b828dc7..48379031537 100644 --- a/lib/gitlab/slash_commands/issue_new.rb +++ b/lib/gitlab/slash_commands/issue_new.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class IssueNew < IssueCommand diff --git a/lib/gitlab/slash_commands/issue_search.rb b/lib/gitlab/slash_commands/issue_search.rb index ee78f0f832e..0a705de4484 100644 --- a/lib/gitlab/slash_commands/issue_search.rb +++ b/lib/gitlab/slash_commands/issue_search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class IssueSearch < IssueCommand diff --git a/lib/gitlab/slash_commands/issue_show.rb b/lib/gitlab/slash_commands/issue_show.rb index ffa5184e5cb..5f5fa32ff20 100644 --- a/lib/gitlab/slash_commands/issue_show.rb +++ b/lib/gitlab/slash_commands/issue_show.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands class IssueShow < IssueCommand diff --git a/lib/gitlab/slash_commands/presenters/access.rb b/lib/gitlab/slash_commands/presenters/access.rb index 81f7cd3ffe8..fa163cb098e 100644 --- a/lib/gitlab/slash_commands/presenters/access.rb +++ b/lib/gitlab/slash_commands/presenters/access.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/base.rb b/lib/gitlab/slash_commands/presenters/base.rb index e13808a2720..73814aa180f 100644 --- a/lib/gitlab/slash_commands/presenters/base.rb +++ b/lib/gitlab/slash_commands/presenters/base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/deploy.rb b/lib/gitlab/slash_commands/presenters/deploy.rb index ebae0f57f9b..7d852eb1f9a 100644 --- a/lib/gitlab/slash_commands/presenters/deploy.rb +++ b/lib/gitlab/slash_commands/presenters/deploy.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/help.rb b/lib/gitlab/slash_commands/presenters/help.rb index ab855319077..480d7aa6a30 100644 --- a/lib/gitlab/slash_commands/presenters/help.rb +++ b/lib/gitlab/slash_commands/presenters/help.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/issue_base.rb b/lib/gitlab/slash_commands/presenters/issue_base.rb index 31c1e97efba..b6db103b82b 100644 --- a/lib/gitlab/slash_commands/presenters/issue_base.rb +++ b/lib/gitlab/slash_commands/presenters/issue_base.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/issue_move.rb b/lib/gitlab/slash_commands/presenters/issue_move.rb index 03921729941..ca0644ede95 100644 --- a/lib/gitlab/slash_commands/presenters/issue_move.rb +++ b/lib/gitlab/slash_commands/presenters/issue_move.rb @@ -1,4 +1,6 @@ # coding: utf-8 +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/issue_new.rb b/lib/gitlab/slash_commands/presenters/issue_new.rb index 5964bfe9960..ac78745ae70 100644 --- a/lib/gitlab/slash_commands/presenters/issue_new.rb +++ b/lib/gitlab/slash_commands/presenters/issue_new.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/issue_search.rb b/lib/gitlab/slash_commands/presenters/issue_search.rb index 4e27d668685..0d497efec0e 100644 --- a/lib/gitlab/slash_commands/presenters/issue_search.rb +++ b/lib/gitlab/slash_commands/presenters/issue_search.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters diff --git a/lib/gitlab/slash_commands/presenters/issue_show.rb b/lib/gitlab/slash_commands/presenters/issue_show.rb index 562f15f403c..5a2c79a928e 100644 --- a/lib/gitlab/slash_commands/presenters/issue_show.rb +++ b/lib/gitlab/slash_commands/presenters/issue_show.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Gitlab module SlashCommands module Presenters @@ -38,10 +40,10 @@ module Gitlab end def text - message = "**#{status_text(@resource)}**" + message = ["**#{status_text(@resource)}**"] if @resource.upvotes.zero? && @resource.downvotes.zero? && @resource.user_notes_count.zero? - return message + return message.join end message << " ยท " @@ -49,7 +51,7 @@ module Gitlab message << ":-1: #{@resource.downvotes} " unless @resource.downvotes.zero? message << ":speech_balloon: #{@resource.user_notes_count}" unless @resource.user_notes_count.zero? - message + message.join end def pretext diff --git a/lib/gitlab/slash_commands/result.rb b/lib/gitlab/slash_commands/result.rb index 3669dedf0fe..607c9c8dec1 100644 --- a/lib/gitlab/slash_commands/result.rb +++ b/lib/gitlab/slash_commands/result.rb @@ -1,4 +1,7 @@ -module Gitlab # rubocop:disable Naming/FileName +# rubocop:disable Naming/FileName +# frozen_string_literal: true + +module Gitlab module SlashCommands Result = Struct.new(:type, :message) end |