diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2019-08-26 10:06:15 +0300 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2019-09-06 03:56:54 +0300 |
commit | 70e1a17604a45419b079ab9da5ef69e010b103c6 (patch) | |
tree | 9da29bbf906f1cc8ac15eaa59372de0d5c47d58b /danger/eslint | |
parent | fdc17ebc039e53dd0ed8119c92fac5fd2f43c7fe (diff) |
Update some Danger rules to not rely upon CI
Convert a bunch of Danger rules so they can run
locally.
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 |