diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-09-06 14:21:53 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-09-06 14:21:53 +0300 |
commit | 9fc9ab2ba2b0db05f6365054aa3bddcda3c7333d (patch) | |
tree | d59a451e3300c4598f2aa66d4b6e82b0b3fa56ef /danger/eslint | |
parent | 3441092b3840cecb913068542ee9242ea19a2017 (diff) |
Add new GitlabDanger class
This class encapsulates our use of the Danger gem.
Diffstat (limited to 'danger/eslint')
-rw-r--r-- | danger/eslint/Dangerfile | 22 |
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 |