diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2019-09-06 09:22:02 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2019-09-06 09:22:02 +0300 |
commit | 351d72cbed57c5b117e6b2239dffabcedbc45046 (patch) | |
tree | 0c1d87332450741f710e159485a0f1e8899767ee /danger/prettier/Dangerfile | |
parent | 13227500f29d8a74c77cba23b7dfdb4169222821 (diff) | |
parent | 70e1a17604a45419b079ab9da5ef69e010b103c6 (diff) |
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/prettier/Dangerfile')
-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 |