diff options
| author | Phil Hughes <me@iamphill.com> | 2017-05-03 17:04:47 +0100 |
|---|---|---|
| committer | Phil Hughes <me@iamphill.com> | 2017-05-03 17:04:47 +0100 |
| commit | f29e5d4d93123ea73e5f58be46020781af2ef7cb (patch) | |
| tree | d08a8f8e5a9cf30dd4f238c187673ffe30ac39b3 /scripts/static-analysis | |
| parent | 4134d700623404948f163349882caf4a6d940cf3 (diff) | |
| parent | 8f29bf96b9306fd95b9b98019e80173b47b3a6b8 (diff) | |
| download | gitlab-ce-f29e5d4d93123ea73e5f58be46020781af2ef7cb.tar.gz | |
Merge branch 'master' into deploy-keys-load-async
Diffstat (limited to 'scripts/static-analysis')
| -rwxr-xr-x | scripts/static-analysis | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/scripts/static-analysis b/scripts/static-analysis new file mode 100755 index 00000000000..192d9d4c3ba --- /dev/null +++ b/scripts/static-analysis @@ -0,0 +1,40 @@ +#!/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 rake brakeman], + %w[bundle exec license_finder], + %w[scripts/lint-doc.sh], + %w[yarn run eslint], + %w[bundle exec rubocop --require rubocop-rspec] +] + +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 |
