# frozen_string_literal: true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'

RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new

desc 'Run experimental solargraph type checker'
task :solargraph do
  sh 'solargraph typecheck'
end

namespace :bundle do
  desc 'Check for vulnerabilities with bundler-audit'
  task :audit do
    sh 'bundler-audit check --ignore GHSA-vvfq-8hwr-qm4m --ignore GHSA-wx95-c6cv-8532 --ignore GHSA-c4rq-3m3g-8wgx --ignore GHSA-v2fc-qm4h-8hqv' if !RUBY_VERSION.start_with?('3.0', '3.1')
  end
end

task default: [:rubocop, :spec, 'bundle:audit']

desc 'Run all tasks desired for CI'
task ci: [:default]
