2017-04-28 11:31:18 -04: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 12:00:49 -04:00
|
|
|
%w[bundle exec rubocop --parallel],
|
2017-09-27 04:52:03 -04:00
|
|
|
%w[bundle exec rake gettext:lint],
|
2017-12-25 05:20:50 -05:00
|
|
|
%w[bundle exec rake lint:static_verification],
|
|
|
|
%w[scripts/lint-changelog-yaml],
|
|
|
|
%w[scripts/lint-conflicts.sh]
|
2017-04-28 11:31:18 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
failed_tasks = tasks.reduce({}) do |failures, task|
|
2017-11-03 12:00:49 -04:00
|
|
|
start = Time.now
|
|
|
|
puts
|
|
|
|
puts "$ #{task.join(' ')}"
|
2017-04-28 11:31:18 -04:00
|
|
|
|
2017-11-03 12:00:49 -04:00
|
|
|
output, status = Gitlab::Popen.popen(task)
|
|
|
|
puts "==> Finished in #{Time.now - start} seconds"
|
|
|
|
puts
|
2017-04-28 11:31:18 -04:00
|
|
|
|
|
|
|
failures[task.join(' ')] = output unless status.zero?
|
|
|
|
|
|
|
|
failures
|
|
|
|
end
|
|
|
|
|
2017-11-03 12:00:49 -04:00
|
|
|
puts
|
|
|
|
puts '==================================================='
|
|
|
|
puts
|
|
|
|
puts
|
|
|
|
|
2017-04-28 11:31:18 -04:00
|
|
|
if failed_tasks.empty?
|
|
|
|
puts 'All static analyses passed successfully.'
|
|
|
|
else
|
2017-11-03 12:00:49 -04:00
|
|
|
puts 'Some static analyses failed:'
|
2017-04-28 11:31:18 -04:00
|
|
|
|
|
|
|
failed_tasks.each do |failed_task, output|
|
2017-11-03 12:00:49 -04:00
|
|
|
puts
|
|
|
|
puts "**** #{failed_task} failed with the following error:"
|
|
|
|
puts
|
2017-04-28 11:31:18 -04:00
|
|
|
puts output
|
|
|
|
end
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
end
|