2017-04-28 15:31:18 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require ::File.expand_path('../lib/gitlab/popen', __dir__)
|
|
|
|
|
|
|
|
tasks = [
|
|
|
|
%w[bundle exec rake config_lint],
|
|
|
|
%w[bundle exec rake flay],
|
|
|
|
%w[bundle exec rake haml_lint],
|
|
|
|
%w[bundle exec rake scss_lint],
|
|
|
|
%w[bundle exec license_finder],
|
|
|
|
%w[yarn run eslint],
|
2017-11-03 16:00:49 +00:00
|
|
|
%w[bundle exec rubocop --parallel],
|
2017-09-27 08:52:03 +00:00
|
|
|
%w[bundle exec rake gettext:lint],
|
2017-12-25 10:20:50 +00:00
|
|
|
%w[bundle exec rake lint:static_verification],
|
|
|
|
%w[scripts/lint-changelog-yaml],
|
|
|
|
%w[scripts/lint-conflicts.sh]
|
2017-04-28 15:31:18 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
failed_tasks = tasks.reduce({}) do |failures, task|
|
2017-11-03 16:00:49 +00:00
|
|
|
start = Time.now
|
|
|
|
puts
|
|
|
|
puts "$ #{task.join(' ')}"
|
2017-04-28 15:31:18 +00:00
|
|
|
|
2017-11-03 16:00:49 +00:00
|
|
|
output, status = Gitlab::Popen.popen(task)
|
|
|
|
puts "==> Finished in #{Time.now - start} seconds"
|
|
|
|
puts
|
2017-04-28 15:31:18 +00:00
|
|
|
|
|
|
|
failures[task.join(' ')] = output unless status.zero?
|
|
|
|
|
|
|
|
failures
|
|
|
|
end
|
|
|
|
|
2017-11-03 16:00:49 +00:00
|
|
|
puts
|
|
|
|
puts '==================================================='
|
|
|
|
puts
|
|
|
|
puts
|
|
|
|
|
2017-04-28 15:31:18 +00:00
|
|
|
if failed_tasks.empty?
|
|
|
|
puts 'All static analyses passed successfully.'
|
|
|
|
else
|
2017-11-03 16:00:49 +00:00
|
|
|
puts 'Some static analyses failed:'
|
2017-04-28 15:31:18 +00:00
|
|
|
|
|
|
|
failed_tasks.each do |failed_task, output|
|
2017-11-03 16:00:49 +00:00
|
|
|
puts
|
|
|
|
puts "**** #{failed_task} failed with the following error:"
|
|
|
|
puts
|
2017-04-28 15:31:18 +00:00
|
|
|
puts output
|
|
|
|
end
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
end
|