Sha256: f8c21c38d1704481ffd8d6198252de2bb0dc66c0a3f19ae92b66e641d783c25d

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

# typed: ignore

# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"
require "rubocop/rake_task"
# require "sorbet-runtime"

# T.bind(self, T.all(Rake::DSL, Object))

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

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-sorbet'
end

namespace :mdl do
  desc 'Format markdown files with markdownlint'
  task :format do
    system("bundle exec mdl #{Dir.glob("**/*.md") * ?\s}")
    puts "#{$?.success? ? :no : :some} errors found"
  end
end

namespace :sorbet do
  desc 'Type-checking with sorbet'
  task :check do
    system("bundle exec srb tc")
  end

  desc 'Type-checking and auto-fix correctable errors with sorbet'
  task :autocorrect do
    system("bundle exec srb tc --autocorrect")
  end
end

namespace :tapioca do
  desc 'Generate RBI from gems with tapioca'
  task :gen do
    system("bundle exec tapioca gem --all")
  end

  desc 'Check duplicated definitions exists in shim RBIs with tapioca'
  task :check_shims do
    system("bundle exec tapioca check-shims")
  end
end

task :default do
   %i[mdl:format rubocop:autocorrect_all sorbet:autocorrect tapioca:check_shims spec].each do
     puts <<~EOS
       .。*゚+.*.。  #{padding = ?= * _1.size}  ゚+..。*゚+
       .。*゚+.*.。  #{_1}  ゚+..。*゚+
       .。*゚+.*.。  #{padding}  ゚+..。*゚+
     EOS
     Rake::Task[_1].execute
   end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tsumanne-0.0.3 Rakefile
tsumanne-0.0.2 Rakefile