-
Notifications
You must be signed in to change notification settings - Fork 2
88 lines (80 loc) · 2.51 KB
/
lint.yml
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
name: Linter
on: push
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: "16"
style: "file"
cmake-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run cmake-format style check
uses: PuneetMatharu/cmake-format-lint-action@v1.0.4
with:
args: --check
find-todos-fixme:
name: Find todos and fixmes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run todo check
run: |
if grep -riE -n 'TODO|FIXME' * | grep -v -i 'TODOLater'; then
exit 1
else
echo "All good"
fi
find-missing-std:
name: "Find missing std::"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run check for missing std namespace prefix
run: |
IDENTIFIERS="uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t size_t"
for identifier in $IDENTIFIERS; do
if grep -r -n "$identifier" | grep -v "std::" | grep -v "ssize_t" | grep -v "lint.yml"; then
echo "[ERROR] found $identifier without std:: prefix"
exit 1
fi
done
find-redundant-hyped:
name: "Find redundant hyped:: namespaces"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run check for extra hyped namespace prefix
run: |
if grep -riE -n "hyped::" | grep -v "namespace"; then
echo "[ERROR] found redundant hyped:: prefix"
exit 1
fi
working-directory: lib
check-header-pragma-once:
name: Check headers for \#pragma once
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run check for missing header pragma once
run: |
if grep -rL "#pragma once" --include \*.hpp | grep -v "lint.yml"; then
echo "[ERROR] found header without #pragma once"
exit 1
fi
check-no-crlf:
name: Check no crlf line endings
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run check for CRLF line endings
run: |
if git ls-files --eol | grep crlf; then
echo "[ERROR] found CRLF line endings, install dos2unix and run 'find . -type f -exec dos2unix {} \;' to fix"
exit 1
fi