summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tasks/lint.rake28
-rwxr-xr-xscripts/static-analysis7
2 files changed, 29 insertions, 6 deletions
diff --git a/lib/tasks/lint.rake b/lib/tasks/lint.rake
index 3ab406eff2c..e7812ff3568 100644
--- a/lib/tasks/lint.rake
+++ b/lib/tasks/lint.rake
@@ -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
diff --git a/scripts/static-analysis b/scripts/static-analysis
index bdb88f3cb57..db4df4ee6cb 100755
--- a/scripts/static-analysis
+++ b/scripts/static-analysis
@@ -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]
]