-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
53 lines (43 loc) · 1022 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# frozen_string_literal: true
require 'bundler/gem_tasks'
require 'rake/testtask'
begin
require 'rubocop/rake_task'
rescue LoadError
puts 'can not use rubocop in this environment'
else
RuboCop::RakeTask.new
end
task default: [:test_behaviors]
task test_behaviors: [:test]
desc 'Simulate CI results in local machine as possible'
multitask simulate_ci: [:test_behaviors, :rubocop]
Rake::TestTask.new(:test) do |tt|
tt.pattern = 'test/**/test_*.rb'
tt.warning = true
end
desc 'Prevent miss packaging!'
task :view_packaging_files do
sh 'rm -rf ./pkg'
sh 'rake build'
cd 'pkg' do
sh 'gem unpack *.gem'
sh 'tree -I *\.gem'
end
sh 'rm -rf ./pkg'
end
desc 'Print dependencies'
task :deps do
sh('ruby --version')
sh('dprint --version')
sh('tree --version')
sh('typos --version')
sh('nix --version')
sh('nixfmt --version')
end
desc 'Linters except ruby'
task :linters do
sh('dprint check')
sh('typos . .github .vscode')
sh(%q!git ls-files '*.nix' | xargs nixfmt --check!)
end