mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
DEV: Run prettier and rubocop in parallel for CI (#17357)
This commit is contained in:
parent
c32ac45b29
commit
1121062aa9
2 changed files with 5 additions and 5 deletions
4
.github/workflows/linting.yml
vendored
4
.github/workflows/linting.yml
vendored
|
@ -62,7 +62,7 @@ jobs:
|
||||||
|
|
||||||
- name: Rubocop
|
- name: Rubocop
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: bundle exec rubocop .
|
run: bundle exec rubocop --parallel .
|
||||||
|
|
||||||
- name: ESLint (core)
|
- name: ESLint (core)
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
|
@ -76,7 +76,7 @@ jobs:
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
run: |
|
run: |
|
||||||
yarn prettier -v
|
yarn prettier -v
|
||||||
yarn prettier --list-different \
|
yarn pprettier --list-different \
|
||||||
"app/assets/stylesheets/**/*.scss" \
|
"app/assets/stylesheets/**/*.scss" \
|
||||||
"app/assets/javascripts/**/*.js" \
|
"app/assets/javascripts/**/*.js" \
|
||||||
"plugins/**/assets/stylesheets/**/*.scss" \
|
"plugins/**/assets/stylesheets/**/*.scss" \
|
||||||
|
|
|
@ -44,7 +44,7 @@ end
|
||||||
def run_or_fail_prettier(*patterns)
|
def run_or_fail_prettier(*patterns)
|
||||||
if patterns.any? { |p| Dir[p].any? }
|
if patterns.any? { |p| Dir[p].any? }
|
||||||
patterns = patterns.map { |p| "'#{p}'" }.join(' ')
|
patterns = patterns.map { |p| "'#{p}'" }.join(' ')
|
||||||
run_or_fail("yarn prettier --list-different #{patterns}")
|
run_or_fail("yarn pprettier --list-different #{patterns}")
|
||||||
else
|
else
|
||||||
puts "Skipping prettier. Pattern not found."
|
puts "Skipping prettier. Pattern not found."
|
||||||
true
|
true
|
||||||
|
@ -84,12 +84,12 @@ task 'docker:test' do
|
||||||
|
|
||||||
unless ENV["SKIP_CORE"]
|
unless ENV["SKIP_CORE"]
|
||||||
puts "Listing prettier offenses in core:"
|
puts "Listing prettier offenses in core:"
|
||||||
@good &&= run_or_fail('yarn prettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.js"')
|
@good &&= run_or_fail('yarn pprettier --list-different "app/assets/stylesheets/**/*.scss" "app/assets/javascripts/**/*.js"')
|
||||||
end
|
end
|
||||||
|
|
||||||
unless ENV["SKIP_PLUGINS"]
|
unless ENV["SKIP_PLUGINS"]
|
||||||
puts "Listing prettier offenses in plugins:"
|
puts "Listing prettier offenses in plugins:"
|
||||||
@good &&= run_or_fail('yarn prettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"')
|
@good &&= run_or_fail('yarn pprettier --list-different "plugins/**/assets/stylesheets/**/*.scss" "plugins/**/assets/javascripts/**/*.{js,es6}"')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue