.github: Run luacheck v1.2.0 in CI#32755
Conversation
|
@cclauss We already run lua check in CI. ardupilot/.github/workflows/test_scripting.yml Lines 36 to 46 in c49a68d Were just not getting the latest version for some reason. |
|
Should probably at least be ubuntu-latest
Ubuntu 22.04.5 LTS Ubuntu 24.04.4 LTS Ubuntu Resolute Raccoon (development branch) The GitHub Action - uses: lunarmodules/luacheck@v1 pulls in a Docker container with the current version. |
|
All of CI is on 22.04, I'm not really qualified to say if we should change over or not. |
We need a .luacheckrc file to ignore those warnings. |
We do have one already, https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_Scripting/tests/luacheck.lua All it needs to run the latest version of luacheck in the existing check. We don't need to re-invent the wheel. |
|
Excellent! We could add the Docker image inside the GitHub Action to get the current version. Closing. |
|
https://github.com/search?q=repo:ArduPilot/ardupilot+setfenv But setfenv was removed in Lua >= v5.2 which is causing luacheck v1.2.0 to fail.
|
I knew that was going to happen eventually. I was hoping we could run latest luacheck on older lua. I suspect its possible to do it some other way, reading the docs file directly worked quite well but it maybe that we need to generate a config directly when we generate the bindings or something like that. |
Summary
Run luacheck in GitHub Actions CI.
Classification & Testing (check all that apply and add your own)
Description
As discussed below, we already run an old version of luacheck in GitHub Actions, which finds no issues.
The GitHub Action from the luacheck team enables us to run the current version, which raises 12k+ warnings.
With the
.luacheckrcfile: