summaryrefslogtreecommitdiff
path: root/danger/eslint
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-09-06 06:22:02 +0000
committerLin Jen-Shin <godfat@godfat.org>2019-09-06 06:22:02 +0000
commit351d72cbed57c5b117e6b2239dffabcedbc45046 (patch)
tree0c1d87332450741f710e159485a0f1e8899767ee /danger/eslint
parent13227500f29d8a74c77cba23b7dfdb4169222821 (diff)
parent70e1a17604a45419b079ab9da5ef69e010b103c6 (diff)
downloadgitlab-ce-351d72cbed57c5b117e6b2239dffabcedbc45046.tar.gz
Merge branch '66596-allow-danger-to-be-run-locally' into 'master'
Break up Danger rules into local or CI only See merge request gitlab-org/gitlab-ce!32196
Diffstat (limited to 'danger/eslint')
-rw-r--r--danger/eslint/Dangerfile22
1 files changed, 12 insertions, 10 deletions
diff --git a/danger/eslint/Dangerfile b/danger/eslint/Dangerfile
index 4916cacfd7e..92830bd7706 100644
--- a/danger/eslint/Dangerfile
+++ b/danger/eslint/Dangerfile
@@ -13,17 +13,19 @@ return if eslint_candidates.empty?
warn 'This merge request changed files with disabled eslint rules. Please consider fixing them.'
-markdown(<<~MARKDOWN)
- ## Disabled eslint rules
+if GitlabDanger.new(helper.gitlab_helper).ci?
+ markdown(<<~MARKDOWN)
+ ## Disabled eslint rules
- The following files have disabled `eslint` rules. Please consider fixing them:
+ The following files have disabled `eslint` rules. Please consider fixing them:
- * #{eslint_candidates.map { |path| "`#{path}`" }.join("\n* ")}
+ * #{eslint_candidates.map { |path| "`#{path}`" }.join("\n* ")}
- Run the following command for more details
+ Run the following command for more details
- ```
- node_modules/.bin/eslint --report-unused-disable-directives --no-inline-config \\
- #{eslint_candidates.map { |path| " '#{path}'" }.join(" \\\n")}
- ```
-MARKDOWN
+ ```
+ node_modules/.bin/eslint --report-unused-disable-directives --no-inline-config \\
+ #{eslint_candidates.map { |path| " '#{path}'" }.join(" \\\n")}
+ ```
+ MARKDOWN
+end