-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
29 lines (22 loc) · 872 Bytes
/
Rakefile
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
# frozen_string_literal: true
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require_relative 'config/application'
Rails.application.load_tasks
Rake::Task[:default].prerequisites.clear if Rake::Task.task_defined?(:default)
desc 'Run all checks'
task default: %w[spec eslint stylelint rubocop] do
puts '>>>>>> [OK] All checks passed!'
end
desc 'Apply auto-corrections'
task fix: %w[eslint:autocorrect stylelint:autocorrect rubocop:autocorrect_all] do
puts '>>>>>> [OK] All fixes applied!'
end
# Trigger run mermaid_erd after db:migrate
if Rails.env.development?
Rake::Task['db:migrate'].enhance do
puts 'Running mermaid_erd after db:migrate...'
system('bundle exec rails mermaid_erd')
puts '>>>>>> Generated mermaid_erd done!'
end
end