summaryrefslogtreecommitdiff
path: root/danger/frozen_string/Dangerfile
diff options
context:
space:
mode:
authorAsh McKenzie <amckenzie@gitlab.com>2019-08-26 17:06:15 +1000
committerAsh McKenzie <amckenzie@gitlab.com>2019-09-06 10:56:54 +1000
commit70e1a17604a45419b079ab9da5ef69e010b103c6 (patch)
tree9da29bbf906f1cc8ac15eaa59372de0d5c47d58b /danger/frozen_string/Dangerfile
parentfdc17ebc039e53dd0ed8119c92fac5fd2f43c7fe (diff)
downloadgitlab-ce-70e1a17604a45419b079ab9da5ef69e010b103c6.tar.gz
Update some Danger rules to not rely upon CI66596-allow-danger-to-be-run-locally
Convert a bunch of Danger rules so they can run locally.
Diffstat (limited to 'danger/frozen_string/Dangerfile')
-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