@@ -15,6 +15,8 @@ task "release", [:remote] => ["build", "release:guard_clean", "release:rubygem_p
1515 puts "Built and pushed gem to RubyGems without pushing to source control."
1616end
1717
18+ ## Development
19+
1820desc "Run normal tests (exclude no_missing_require_* specs)"
1921task :test_normal do
2022 sh "bundle exec rspec --exclude-pattern 'spec/line/bot/line_bot_api_gem_spec.rb,spec/line/bot/line_bot_gem_spec.rb'"
3335desc "Run all tests in separate processes"
3436task :test do
3537 Rake ::Task [ :test_normal ] . invoke
36-
3738 Rake ::Task [ :test_line_bot_api ] . invoke
38-
3939 Rake ::Task [ :test_line_bot ] . invoke
4040end
41+
42+ desc "Validate comment for YARD"
43+ task :validate_yard_comment do
44+ sh "bundle exec yard stats ./lib/line/bot/v2 --fail-on-warning"
45+ end
46+
47+ desc "RBS type check"
48+ task :rbs do
49+ sh "bundle exec rbs collection install"
50+ sh "bundle exec rbs -I sig validate"
51+ end
52+
53+ desc "Run rubocop"
54+ task :rubocop do
55+ sh "bundle exec rubocop"
56+ end
57+
58+ desc "Fix rubocop errors"
59+ task :rubocop_fix do
60+ sh "bundle exec rubocop -A"
61+ end
62+
63+ desc "Check buildable and its contents"
64+ task :build_test do
65+ sh "bundle exec rake build"
66+ sh "tar -xvf pkg/line-bot-api-*.gem"
67+
68+ puts "<<Show the contents of the gem>>"
69+ sh "tar -zxvf data.tar.gz"
70+
71+ puts "<<clean up>>"
72+ sh "rm -rf pkg/"
73+ sh "rm -rf data.tar.gz"
74+ sh "rm -rf checksums.yaml.gz"
75+ sh "rm -rf metadata.gz"
76+ end
77+
78+ desc "Run all tasks for development check and test"
79+ task :ci do
80+ Rake ::Task [ :test ] . invoke
81+ Rake ::Task [ :rubocop ] . invoke
82+ Rake ::Task [ :validate_yard_comment ] . invoke
83+ Rake ::Task [ :rbs ] . invoke
84+ Rake ::Task [ :build_test ] . invoke
85+ end
0 commit comments