2018-07-26 09:25:40 -05:00
if github.pr_json && (github.pr_json["additions"] || 0) > 250 || (github.pr_json["deletions"] || 0) > 250
2018-07-25 13:36:09 -05:00
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?")
2018-07-24 09:12:15 -05:00
end
2018-07-24 12:35:47 -05:00
prettier_offenses = `prettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.es6" "test/javascripts/**/*.es6"`.split('\n')
2018-07-24 10:31:57 -05:00
if !prettier_offenses.empty?
2018-07-24 09:12:15 -05:00
fail(%{
2018-07-26 14:45:01 -05:00
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
2018-07-26 10:03:36 -05:00
#{prettier_offenses.map { |o| github.html_link(o) }.join("\n")}
2018-07-24 09:12:15 -05:00
})
end