-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 1.92 KB
/
lint.yml
File metadata and controls
60 lines (58 loc) · 1.92 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
name: Lint & Static Analysis
on:
pull_request:
branches: [ main, dev ]
push:
branches: [ main, dev ]
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: sudo apt-get update && sudo apt-get install -y clang-format
- name: Check formatting
run: |
# Exclude vendored third-party sources from formatting checks.
files=$(git ls-files '*.h' '*.cpp' '*.ino' | grep -v '^src/third_party/' || true)
echo "Checking clang-format on: $files"
diff_found=0
for f in $files; do
clang-format -style=file $f | diff -u $f - || diff_found=1
done
if [ $diff_found -ne 0 ]; then
echo "Formatting issues detected. Run clang-format." >&2
exit 1
fi
cpplint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cpplint
run: pip install cpplint
- name: Run cpplint
run: |
# Keep third_party out of lint noise.
files=$(git ls-files src | grep -E '\\.(h|cpp)$' | grep -v '^src/third_party/' || true)
if [ -n "$files" ]; then
cpplint $files || true
fi
# We don't fail hard yet; adjust policy later
cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck
- name: Run cppcheck
run: |
cppcheck --enable=warning,style,performance --inline-suppr \
--suppress=missingIncludeSystem \
-I src --quiet src --exclude=src/third_party || true
version-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run version sync check
run: |
bash scripts/verify-release.sh || (echo "Version sync failed" && exit 1)