-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
77 lines (69 loc) · 1.97 KB
/
Taskfile.yml
File metadata and controls
77 lines (69 loc) · 1.97 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: '3'
vars:
CPP_FILES:
sh: |
git ls-files '*.hpp' '*.cpp' '*.cc' '*.cxx' \
':(exclude)ac-library/**'
CHANGED_CPP_FILES:
sh: |
git diff --name-only -- '*.hpp' '*.cpp' '*.cc' '*.cxx' \
':(exclude)ac-library/**' \
| tr '\n' ' ' \
| sed 's/[[:space:]]*$//'
tasks:
default:
desc: Show available tasks.
cmds:
- task --list
silent: true
fmt:
desc: Format all tracked C++ sources except ac-library.
aliases: [format]
cmds:
- |
if [ -z "{{.CPP_FILES}}" ]; then
echo "no C++ files found"
exit 0
fi
printf '%s\n' "{{.CPP_FILES}}" | xargs clang-format -i
fmt-check:
desc: Check formatting for all tracked C++ sources except ac-library.
cmds:
- |
if [ -z "{{.CPP_FILES}}" ]; then
echo "no C++ files found"
exit 0
fi
printf '%s\n' "{{.CPP_FILES}}" | xargs clang-format --dry-run --Werror
fmt-changed:
desc: Format changed C++ sources except ac-library.
cmds:
- |
if [ -z "{{.CHANGED_CPP_FILES}}" ]; then
echo "no changed C++ files"
exit 0
fi
clang-format -i {{.CHANGED_CPP_FILES}}
lint:
desc: Run clang-tidy for all tracked C++ sources except ac-library.
cmds:
- |
if [ -z "{{.CPP_FILES}}" ]; then
echo "no C++ files found"
exit 0
fi
printf '%s\n' "{{.CPP_FILES}}" \
| xargs -n 20 clang-tidy --extra-arg=-std=c++17 --extra-arg=-I. --extra-arg=-Iac-library
lint-changed:
desc: Run clang-tidy for changed C++ sources except ac-library.
cmds:
- |
if [ -z "{{.CHANGED_CPP_FILES}}" ]; then
echo "no changed C++ files"
exit 0
fi
clang-tidy {{.CHANGED_CPP_FILES}} --extra-arg=-std=c++17 --extra-arg=-I. --extra-arg=-Iac-library
verify:
desc: Run online-judge-verify tests with the current config.
cmds:
- oj-verify run