summaryrefslogtreecommitdiff
path: root/scripts/static-analysis
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-05-04 16:01:40 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-05-04 16:01:40 +0100
commit863d830427c2a30f2867d15862e4854924289c63 (patch)
tree337ce7b647f31e3d98a7c66a2c038b2fefdfe6ac /scripts/static-analysis
parentf0329ba90ff00380e9a618c4757630f9b134eed3 (diff)
parent3441e60fd9d8d3ce111b1ece93ae867b3938f7e5 (diff)
downloadgitlab-ce-24339-job-page-step-1.tar.gz
Merge branch '24339-job-page' into 24339-job-page-step-124339-job-page-step-1
* 24339-job-page: (274 commits) Document serializers Pipeline table mini graph dropdown remains open when table is refreshed Adds off for event hub Compile gitlab-shell go executables Allow to create new branch and empty WIP merge request from issue page Moved to a view spec Improving copy of CONTRIBUTING.md, PROCESS.md, and code_review.md Convert seconds to minutes and hours on chat notifations Disable navigation to Pages config if Pages is disabled Sort the network graph both by commit date and topographically. Add breadcrumb, build header and pipelines submenu to artifacts browser Update todos screenshots removes the possibility of commit messages having carriage returns Handle incoming emails from aliases correctly Allow commenting on older versions of the diff and comparisons between diff versions Add real-time note edits :chipmunk: Move api lint out of static analysis job Fix project tree saver and fork spec failures Update ToC of CONTRIBUTING.md and PROCESS.md Improve the Code review guidelines documentation ...
Diffstat (limited to 'scripts/static-analysis')
-rwxr-xr-xscripts/static-analysis39
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/static-analysis b/scripts/static-analysis
new file mode 100755
index 00000000000..1bd6b339830
--- /dev/null
+++ b/scripts/static-analysis
@@ -0,0 +1,39 @@
+#!/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[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