diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2019-12-13 19:47:39 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2019-12-13 19:47:39 +0300 |
commit | 85d95020bdf7e30f82811572e9f521d52e316aab (patch) | |
tree | 9e974b419c011ac50b22a618e23902111498f9c5 | |
parent | feb48996e3312f08123388ef5f354ee414c46109 (diff) | |
parent | aa79ec3ca7ae2571f4d180015c0bd8195056c705 (diff) |
Merge branch 'ac-fix-12-1' into 12-1-stable
-rwxr-xr-x | scripts/static-analysis | 61 |
1 files changed, 8 insertions, 53 deletions
diff --git a/scripts/static-analysis b/scripts/static-analysis index 642c50ec0a8..0972fe081f5 100755 --- a/scripts/static-analysis +++ b/scripts/static-analysis @@ -4,27 +4,6 @@ require_relative '../lib/gitlab/popen' require_relative '../lib/gitlab/popen/runner' -def emit_warnings(static_analysis) - static_analysis.warned_results.each do |result| - puts - puts "**** #{result.cmd.join(' ')} had the following warning(s):" - puts - puts result.stderr - puts - end -end - -def emit_errors(static_analysis) - static_analysis.failed_results.each do |result| - puts - puts "**** #{result.cmd.join(' ')} failed with the following error(s):" - puts - puts result.stdout - puts result.stderr - puts - end -end - tasks = [ %w[bin/rake lint:all], %w[bundle exec license_finder], @@ -36,37 +15,13 @@ tasks = [ %w[scripts/lint-rugged] ] -static_analysis = Gitlab::Popen::Runner.new - -static_analysis.run(tasks) do |cmd, &run| - puts - puts "$ #{cmd.join(' ')}" - - result = run.call +tasks.each do |task| + cmd = task.join(' ') + puts "$ #{cmd}" + result = system(cmd) - puts "==> Finished in #{result.duration} seconds" - puts -end - -puts -puts '===================================================' -puts -puts - -if static_analysis.all_success_and_clean? - puts 'All static analyses passed successfully.' -elsif static_analysis.all_success? - puts 'All static analyses passed successfully, but we have warnings:' - puts - - emit_warnings(static_analysis) - - exit 2 -else - puts 'Some static analyses failed:' - - emit_warnings(static_analysis) - emit_errors(static_analysis) - - exit 1 + unless result + puts "#{cmd} failed!" + exit 1 + end end |