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/prettier | |
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/prettier')
-rw-r--r-- | danger/prettier/Dangerfile | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/danger/prettier/Dangerfile b/danger/prettier/Dangerfile index 37c4b78a213..0be75db8baa 100644 --- a/danger/prettier/Dangerfile +++ b/danger/prettier/Dangerfile @@ -19,21 +19,23 @@ return if unpretty.empty? warn 'This merge request changed frontend files without pretty printing them.' -markdown(<<~MARKDOWN) - ## Pretty print Frontend files +if GitlabDanger.new(helper.gitlab_helper).ci? + markdown(<<~MARKDOWN) + ## Pretty print Frontend files - The following files should have been pretty printed with `prettier`: + The following files should have been pretty printed with `prettier`: - * #{unpretty.map { |path| "`#{path}`" }.join("\n* ")} + * #{unpretty.map { |path| "`#{path}`" }.join("\n* ")} - Please run + Please run - ``` - node_modules/.bin/prettier --write \\ - #{unpretty.map { |path| " '#{path}'" }.join(" \\\n")} - ``` + ``` + node_modules/.bin/prettier --write \\ + #{unpretty.map { |path| " '#{path}'" }.join(" \\\n")} + ``` - Also consider auto-formatting [on-save]. + Also consider auto-formatting [on-save]. - [on-save]: https://docs.gitlab.com/ee/development/new_fe_guide/style/prettier.html -MARKDOWN + [on-save]: https://docs.gitlab.com/ee/development/new_fe_guide/style/prettier.html + MARKDOWN +end |