Skip to content

Commit 729bc8c

Browse files
committed
ci: run clang-tidy for each lua version individually
1 parent c4e42d1 commit 729bc8c

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.github/workflows/check.yml

+17-3
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,26 @@ jobs:
7171
exit 2
7272
fi
7373
74-
# install X11 headers
75-
sudo apt-get install --yes --no-install-recommends libx11-dev
74+
# get required header files
75+
sudo apt-get install --yes --no-install-recommends \
76+
libx11-dev \
77+
liblua5.1-dev \
78+
liblua5.2-dev \
79+
liblua5.3-dev \
80+
liblua5.4-dev \
81+
libluajit-5.1-dev
7682
7783
shopt -s nullglob
7884
files=(src/*.c src/**/*.c include/*.h include/**/*.h)
7985
if [[ "${#files[@]}" -eq 0 ]]; then
8086
echo "No files found"
8187
exit 1
8288
fi
83-
clang-tidy-18 --extra-arg="-I.lua/include" --warnings-as-errors="*" "${files[@]}"
89+
clang-tidy-18 --warnings-as-errors="*" --extra-arg="-I/usr/include/lua5.1" "${files[@]}"
90+
clang-tidy-18 --warnings-as-errors="*" --extra-arg="-I/usr/include/lua5.2" "${files[@]}"
91+
clang-tidy-18 --warnings-as-errors="*" --extra-arg="-I/usr/include/lua5.3" "${files[@]}"
92+
clang-tidy-18 --warnings-as-errors="*" --extra-arg="-I/usr/include/lua5.4" "${files[@]}"
93+
clang-tidy-18 --warnings-as-errors="*" --extra-arg="-I/usr/include/luajit-2.1" "${files[@]}"
8494
8595
- name: Set up Lua
8696
uses: luarocks/gh-actions-lua@master
@@ -136,6 +146,10 @@ jobs:
136146
# Will be ignored on non-Windows platforms anyway, but it's better to just skip it
137147
if: matrix.os == 'windows-latest'
138148

149+
- name: Set up X11
150+
if: matrix.os == 'ubuntu-latest'
151+
run: sudo apt-get install --yes --no-install-recommends libx11-dev
152+
139153
- name: Set up Lua
140154
uses: luarocks/gh-actions-lua@master
141155
with:

src/main.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
luaL_checkinteger(L, arg))
2525

2626
#define luaL_optinteger(L, arg, def) \
27-
(lua_isnoneornil(L, arg) ? def : luaL_checkinteger(L, arg))
27+
(lua_isnoneornil(L, arg) ? (def) : luaL_checkinteger(L, arg))
2828

2929
#endif
3030

@@ -629,6 +629,7 @@ FENSTER_EXPORT int luaopen_fenster(lua_State *L) {
629629
luaL_setfuncs(L, window_methods, 0);
630630

631631
// create and return the fenster Lua module
632-
luaL_newlib(L, lfenster_functions);
632+
luaL_newlib( // NOLINT(readability-math-missing-parentheses)
633+
L, lfenster_functions);
633634
return 1;
634635
}

0 commit comments

Comments
 (0)