Combine all rake tasks in the static-analysis job

Signed-off-by: Rémy Coutable <remy@rymai.me>
This commit is contained in:
Rémy Coutable 2018-01-26 15:23:46 +01:00
parent 7294bc80c3
commit e4990b66df
2 changed files with 29 additions and 6 deletions

View file

@ -16,5 +16,33 @@ unless Rails.env.production?
task :javascript do
Rake::Task['eslint'].invoke
end
desc "GitLab | lint | Run several lint checks"
task :all do
status = 0
original_stdout = $stdout
%w[
config_lint
haml_lint
scss_lint
flay
gettext:lint
lint:static_verification
].each do |task|
begin
$stdout = StringIO.new
Rake::Task[task].invoke
rescue RuntimeError, SystemExit => ex
raise ex if ex.is_a?(RuntimeError) && task != 'haml_lint'
original_stdout << $stdout.string
status = 1
ensure
$stdout = original_stdout
end
end
exit status
end
end
end

View file

@ -26,15 +26,10 @@ def emit_errors(static_analysis)
end
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[bin/rake lint:all],
%w[bundle exec license_finder],
%w[yarn run eslint],
%w[bundle exec rubocop --parallel],
%w[bundle exec rake gettext:lint],
%w[bundle exec rake lint:static_verification],
%w[scripts/lint-conflicts.sh],
%w[scripts/lint-rugged]
]