-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
62 lines (48 loc) · 1.13 KB
/
Rakefile
File metadata and controls
62 lines (48 loc) · 1.13 KB
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
61
62
# frozen_string_literal: true
require "bundler/gem_tasks"
require "rb_sys/extensiontask"
require "rspec/core/rake_task"
GEMSPEC = Gem::Specification.load("libsql2.gemspec")
RbSys::ExtensionTask.new("libsql2", GEMSPEC) do |ext|
ext.lib_dir = "lib/libsql"
end
RSpec::Core::RakeTask.new(:spec) do |t|
t.verbose = false
end
task spec: :compile
namespace :lint do
desc "Run RuboCop"
task :rubocop do
sh "bundle exec rubocop"
end
desc "Run Clippy"
task :clippy do
sh "cargo clippy --workspace -- -D warnings"
end
desc "Run all linters"
task all: %i[rubocop clippy]
end
namespace :fmt do
desc "Run RuboCop auto-correct"
task :rubocop do
sh "bundle exec rubocop -a"
end
desc "Run rustfmt"
task :rustfmt do
sh "cargo fmt --all"
end
desc "Run all formatters"
task all: %i[rubocop rustfmt]
end
namespace :fmt do
desc "Check formatting (CI)"
task :check do
sh "bundle exec rubocop --format simple"
sh "cargo fmt --all -- --check"
end
end
desc "Run all linters and format checks"
task lint: ["lint:all"]
desc "Auto-format all code"
task fmt: ["fmt:all"]
task default: %i[compile spec]