Skip to content
Snippets Groups Projects
Commit aa79ec3c authored by Stan Hu's avatar Stan Hu Committed by Alessio Caiazza
Browse files

Simplify static-analysis output generation

The buffering of the output may be causing issues, so let's disable it
for now.
parent feb48996
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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],
Loading
Loading
@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment