Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-09-06 14:21:53 +0300
committerLin Jen-Shin <godfat@godfat.org>2019-09-06 14:21:53 +0300
commit9fc9ab2ba2b0db05f6365054aa3bddcda3c7333d (patch)
treed59a451e3300c4598f2aa66d4b6e82b0b3fa56ef /danger/frozen_string
parent3441092b3840cecb913068542ee9242ea19a2017 (diff)
Add new GitlabDanger class
This class encapsulates our use of the Danger gem.
Diffstat (limited to 'danger/frozen_string')
-rw-r--r--danger/frozen_string/Dangerfile12
1 files changed, 7 insertions, 5 deletions
diff --git a/danger/frozen_string/Dangerfile b/danger/frozen_string/Dangerfile
index b9687ef6b83..8d3ac3dee68 100644
--- a/danger/frozen_string/Dangerfile
+++ b/danger/frozen_string/Dangerfile
@@ -16,11 +16,13 @@ if files_to_fix.any?
warn 'This merge request adds files that do not enforce frozen string literal. ' \
'See https://gitlab.com/gitlab-org/gitlab-ce/issues/47424 for more information.'
- markdown(<<~MARKDOWN)
- ## Enable Frozen String Literal
+ if GitlabDanger.new(helper.gitlab_helper).ci?
+ markdown(<<~MARKDOWN)
+ ## Enable Frozen String Literal
- The following files should have `#{MAGIC_COMMENT}` on the first line:
+ The following files should have `#{MAGIC_COMMENT}` on the first line:
- * #{files_to_fix.map { |path| "`#{path}`" }.join("\n* ")}
- MARKDOWN
+ * #{files_to_fix.map { |path| "`#{path}`" }.join("\n* ")}
+ MARKDOWN
+ end
end