mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 19:00:32 -06:00
improves danger formatting (#6162)
This commit is contained in:
parent
7058205f70
commit
e8b9bd7d9b
11
Dangerfile
11
Dangerfile
@ -7,7 +7,6 @@ end
|
||||
|
||||
to_lint = git.modified_files + git.added_files
|
||||
files_to_lint = Shellwords.join(to_lint)
|
||||
|
||||
rubocop_output = `bundle exec rubocop -f json --parallel #{files_to_lint}`
|
||||
if !rubocop_output.empty?
|
||||
offenses = JSON.parse(rubocop_output)['files']
|
||||
@ -23,16 +22,16 @@ if !rubocop_output.empty?
|
||||
|
||||
if !offenses.empty?
|
||||
fail(%{
|
||||
This PR has multiple rubocop offenses:\n
|
||||
#{offenses.map { |o| format_offense(o) }.join('\n') }
|
||||
This PR has multiple rubocop offenses. We recommend configuring prettier linting in your editor:\n
|
||||
#{offenses.map { |o| format_offense(o) }.join('\n') }
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
prettier_offenses = `prettier --list-different #{files_to_lint}`.split('\n')
|
||||
prettier_offenses = `prettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.es6" "test/javascripts/**/*.es6" "plugins/**/*.scss" "plugins/**/*.es6"`.split('\n')
|
||||
if !prettier_offenses.empty?
|
||||
fail(%{
|
||||
This PR has multiple prettier offenses (we recommend configuring prettier linting in your editor):\n
|
||||
#{prettier_offenses.join("\n")}
|
||||
This PR has multiple prettier offenses (prettier.io). We recommend configuring prettier linting in your editor:\n
|
||||
#{prettier_offenses.join("\n")}
|
||||
})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user