2020-03-06 21:33:29 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2013-04-27 14:07:14 +02:00
|
|
|
require 'bundler/gem_tasks'
|
|
|
|
require 'rspec/core/rake_task'
|
2018-02-23 11:13:28 +01:00
|
|
|
require 'rubocop/rake_task'
|
2018-10-28 12:57:13 +01:00
|
|
|
require 'bundler/audit/task'
|
2013-04-27 14:07:14 +02:00
|
|
|
|
|
|
|
RSpec::Core::RakeTask.new(:spec)
|
2018-02-23 11:13:28 +01:00
|
|
|
RuboCop::RakeTask.new
|
2018-10-28 12:57:13 +01:00
|
|
|
Bundler::Audit::Task.new
|
2013-04-27 14:07:14 +02:00
|
|
|
|
2020-02-28 15:13:28 +01:00
|
|
|
desc 'Run experimental solargraph type checker'
|
2020-08-22 12:20:23 +02:00
|
|
|
task :solargraph do
|
2020-02-28 15:13:28 +01:00
|
|
|
sh 'solargraph typecheck'
|
|
|
|
end
|
|
|
|
|
2020-08-22 12:20:23 +02:00
|
|
|
namespace :solargraph do
|
|
|
|
desc 'Should be run by developer once to prepare initial solargraph usage (fill caches etc.)'
|
|
|
|
task :init do
|
|
|
|
sh 'solargraph download-core'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-04-16 22:27:22 +02:00
|
|
|
# renovate: datasource=github-tags depName=hadolint/hadolint
|
2021-08-26 12:28:35 +02:00
|
|
|
hadolint_version = 'v2.7.0'
|
2021-04-16 22:27:22 +02:00
|
|
|
|
2020-08-22 12:20:23 +02:00
|
|
|
desc 'Run hadolint for Dockerfile linting'
|
|
|
|
task :hadolint do
|
2021-08-26 21:19:34 +02:00
|
|
|
sh "docker run --rm -i hadolint/hadolint:#{hadolint_version} hadolint --ignore DL3018 - < docker/Dockerfile"
|
2020-08-22 12:20:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
task default: [:rubocop, :spec, 'bundle:audit', :solargraph]
|
2020-02-28 15:13:28 +01:00
|
|
|
|
2020-12-25 18:04:59 +01:00
|
|
|
desc 'Run all tasks desired for CI'
|
2021-04-16 18:11:23 +02:00
|
|
|
task ci: ['solargraph:init', :default, :hadolint, :build]
|