-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.toml
96 lines (80 loc) · 2.03 KB
/
Makefile.toml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
[config]
skip_core_tasks = true
default_to_workspace = false
[env]
PROJ_NAME = "apllodb"
[tasks.format]
script = ['''
#!/usr/bin/env bash -eux
cargo fmt --all
''']
[tasks.lint]
script = ['''
#!/usr/bin/env bash -eux
RUSTFLAGS='-D warnings' cargo clippy --workspace --all-targets --all-features
''']
[tasks.build]
script = ['''
#!/usr/bin/env bash -eux
RUSTFLAGS='-D warnings' cargo build --workspace --all-targets --all-features
''']
[tasks.test]
script = ['''
#!/usr/bin/env bash -eux
cargo test --workspace --all-targets --all-features
''']
[tasks.test-cli]
script = ['''
#!/usr/bin/env bash -eux
echo 'CREATE DATABASE abc' | ./target/debug/apllodb-cli
''']
[tasks.doc]
script = ['''
#!/usr/bin/env bash -eux
cargo clean --doc
cargo doc --no-deps --all-features
''']
[tasks.coverage]
script = ['''
#!/usr/bin/env bash -eux
rm -rf target/debug/deps/${PROJ_NAME}-*
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zinstrument-coverage"
export LLVM_PROFILE_FILE="${PROJ_NAME}-%p-%m.profraw"
cargo +nightly build --workspace --verbose
cargo +nightly test --workspace --verbose
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o lcov.info
''']
[tasks.check-easy-panic]
script = ['''
#!/usr/bin/env bash -eux
git ls-files |grep -E '.rs$' |(! xargs grep 'unimplemented!')
git ls-files |grep -E '.rs$' |(! xargs grep 'todo!')
''']
[tasks.check-japanese]
script = ['''
#!/usr/bin/env bash -eux
f=$(mktemp)
git ls-files |xargs perl -Mutf8 -CSD -wnle '/[\p{Han}\p{Hiragana}\p{Katakana}]/ and print;' |( grep -v 'allow(check-japanese)' > $f || : )
if [ $(cat $f |wc -l) -eq 0 ]; then
true
else
cat $f
echo 'ERROR: Some files include Japanese text. To welcome contribution from all over the world, we decided to use only English 💪'
false
fi
''']
[tasks.check-trash]
script = ['''
#!/usr/bin/env bash -eux
if [ ! $(find . -name '*.sqlite3*' |wc -l) = '0' ]; then
echo 'Trash files:'
find . -name '*.sqlite3*'
false
fi
''']
[tasks.clean-trash]
script = ['''
#!/usr/bin/env bash -eux
find . -name '*.sqlite3*' |xargs rm
''']