mirror of
https://github.com/discourse/discourse.git
synced 2025-04-09 04:20:47 +08:00
DEV: yarn prettier
in Danger (#6405)
Use `yarn --silent` to suppress yarn console logs, and only allow for prettier output. Escape sequence (`\n`) does not work in single quotes
This commit is contained in:
parent
b71af05d62
commit
6751662bf8
@ -2,8 +2,9 @@ if github.pr_json && (github.pr_json["additions"] || 0) > 250 || (github.pr_json
|
|||||||
warn("This pull request is big! We prefer smaller PRs whenever possible, as they are easier to review. Can this be split into a few smaller PRs?")
|
warn("This pull request is big! We prefer smaller PRs whenever possible, as they are easier to review. Can this be split into a few smaller PRs?")
|
||||||
end
|
end
|
||||||
|
|
||||||
prettier_offenses = `prettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.es6" "test/javascripts/**/*.es6"`.split('\n')
|
prettier_offenses = `yarn --silent prettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.es6" "test/javascripts/**/*.es6"`.split("\n")
|
||||||
if !prettier_offenses.empty?
|
|
||||||
|
unless prettier_offenses.empty?
|
||||||
fail(%{
|
fail(%{
|
||||||
This PR doesn't match our required code formatting standards, as enforced by prettier.io. <a href='https://meta.discourse.org/t/prettier-code-formatting-tool/93212'>Here's how to set up prettier in your code editor.</a>\n
|
This PR doesn't match our required code formatting standards, as enforced by prettier.io. <a href='https://meta.discourse.org/t/prettier-code-formatting-tool/93212'>Here's how to set up prettier in your code editor.</a>\n
|
||||||
#{prettier_offenses.map { |o| github.html_link(o) }.join("\n")}
|
#{prettier_offenses.map { |o| github.html_link(o) }.join("\n")}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user