2017-04-28 11:31:18 -04:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
|
|
|
|
require ::File.expand_path('../lib/gitlab/popen', __dir__)
|
|
|
|
|
|
|
|
tasks = [
|
2017-08-30 20:39:21 -04:00
|
|
|
%w[bundle exec bundle-audit check --update],
|
2017-04-28 11:31:18 -04:00
|
|
|
%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 rake brakeman],
|
|
|
|
%w[bundle exec license_finder],
|
|
|
|
%w[yarn run eslint],
|
2017-08-01 08:06:56 -04:00
|
|
|
%w[bundle exec rubocop --require rubocop-rspec],
|
2017-07-20 11:32:17 -04:00
|
|
|
%w[scripts/lint-conflicts.sh],
|
2017-09-27 04:52:03 -04:00
|
|
|
%w[bundle exec rake gettext:lint],
|
|
|
|
%w[scripts/lint-changelog-yaml]
|
2017-04-28 11:31:18 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
failed_tasks = tasks.reduce({}) do |failures, task|
|
|
|
|
output, status = Gitlab::Popen.popen(task)
|
|
|
|
|
|
|
|
puts "Running: #{task.join(' ')}"
|
|
|
|
puts output
|
|
|
|
|
|
|
|
failures[task.join(' ')] = output unless status.zero?
|
|
|
|
|
|
|
|
failures
|
|
|
|
end
|
|
|
|
|
|
|
|
if failed_tasks.empty?
|
|
|
|
puts 'All static analyses passed successfully.'
|
|
|
|
else
|
|
|
|
puts "\n===================================================\n\n"
|
|
|
|
puts "Some static analyses failed:"
|
|
|
|
|
|
|
|
failed_tasks.each do |failed_task, output|
|
|
|
|
puts "\n**** #{failed_task} failed with the following error:\n\n"
|
|
|
|
puts output
|
|
|
|
end
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
end
|