diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-06 13:24:36 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-06 13:24:36 +0000 |
commit | a6fad00c16809782b65bb753bfab43292f238fee (patch) | |
tree | 749516fd8dbc5ea42a82d3cb74899b1963296566 | |
parent | cfd09fe88301e3ba01b1bfbfc1454c04f0cca3d9 (diff) | |
parent | d048c8fe43950438d4168f1a0750f6197d1252a1 (diff) | |
download | gitlab-ce-a6fad00c16809782b65bb753bfab43292f238fee.tar.gz |
Merge branch '39790-use-the-parallel-rubocop-option-in-the-static-analysis-ci-job' into 'master'
Resolve "Use the `--parallel` Rubocop option in the static-analysis CI job"
Closes #39790
See merge request gitlab-org/gitlab-ce!15183
-rwxr-xr-x | scripts/static-analysis | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/scripts/static-analysis b/scripts/static-analysis index aeefb2bc96f..51a2fd81a79 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -11,31 +11,40 @@ tasks = [ %w[bundle exec rake brakeman], %w[bundle exec license_finder], %w[yarn run eslint], - %w[bundle exec rubocop --require rubocop-rspec], + %w[bundle exec rubocop --parallel], %w[scripts/lint-conflicts.sh], %w[bundle exec rake gettext:lint], %w[scripts/lint-changelog-yaml] ] failed_tasks = tasks.reduce({}) do |failures, task| - output, status = Gitlab::Popen.popen(task) + start = Time.now + puts + puts "$ #{task.join(' ')}" - puts "Running: #{task.join(' ')}" - puts output + output, status = Gitlab::Popen.popen(task) + puts "==> Finished in #{Time.now - start} seconds" + puts failures[task.join(' ')] = output unless status.zero? failures end +puts +puts '===================================================' +puts +puts + if failed_tasks.empty? puts 'All static analyses passed successfully.' else - puts "\n===================================================\n\n" - puts "Some static analyses failed:" + puts 'Some static analyses failed:' failed_tasks.each do |failed_task, output| - puts "\n**** #{failed_task} failed with the following error:\n\n" + puts + puts "**** #{failed_task} failed with the following error:" + puts puts output end |