1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
# frozen_string_literal: true
require "bundler/gem_tasks"
# Override release task to skip gem push (handled by GitHub Actions with attestations)
Rake::Task["release"].clear
desc "Build gem and create tag (gem push handled by CI)"
task release: %w[build release:guard_clean release:source_control_push]
require "rspec/core/rake_task"
require "rubocop/rake_task"
require "standard/rake"
require "yard"
require "yardstick/rake/measurement"
require "yardstick/rake/verify"
RSpec::Core::RakeTask.new(:spec)
RuboCop::RakeTask.new(:rubocop)
YARD::Rake::YardocTask.new(:yard)
Yardstick::Rake::Measurement.new(:yardstick)
Yardstick::Rake::Verify.new(:verify_measurements) do |verify|
verify.threshold = 100
end
desc "Run RuboCop and Standard Ruby"
task lint: %i[rubocop standard]
desc "Run RSpec"
task test: :spec
desc "Run Mutant"
task :mutant do
if Process.respond_to?(:fork)
sh "bundle exec mutant run"
else
warn "Mutant is disabled (requires fork)"
end
end
STEEP_AVAILABLE = begin
require "steep"
true
rescue LoadError
false
end
desc "Run Steep type checker"
task :steep do
if STEEP_AVAILABLE
sh "bundle exec steep check"
else
warn "Steep is disabled"
end
end
desc "Generate and verify documentation"
task docs: %i[yard verify_measurements]
task default: %i[test lint mutant docs steep]
|