Correct warning in lua attitude module#32734
Conversation
|
I think there are lots of scripts with the same pattern. |
There was a problem hiding this comment.
Thanks for cleaning this up. This was just my laziness when translating from c++ to Lua.
Ideally if you could also update the version at the top of the script.
- MAVLinkAttitude.SCRIPT_VERSION = "4.7.0-009"
+ MAVLinkAttitude.SCRIPT_VERSION = "4.8.0-010"
You've probably seen that this displays at boot time, so you know when flying (and in the logs) which version you are running.
|
How are you getting a warning? |
~ |
Checking libraries/AP_Scripting/modules/mavlink_attitude.lua 2 warnings
libraries/AP_Scripting/modules/mavlink_attitude.lua:37:43: used variable _max_lag_ms with unused hint
libraries/AP_Scripting/modules/mavlink_attitude.lua:37:56: used variable _convergence_loops with unused hint
ccff704 to
2cd861e
Compare
Done.
Nope! :-) |
|
@IamPete1 is there any reason we shouldn't fail CI when these things come up? It should generally be clean by the looks of it |
It passes in CI https://github.com/ArduPilot/ardupilot/actions/runs/24272752988/job/70880824863 More testing is more better, there must be some difference between your setup and what we run in CI. It passes for me too, I get: |
|
https://github.com/lunarmodules/luacheck/releases is currently v1.2.0 from May 24, 2024. |
|
|
@peterbarker Do you have a local |
No |
|
Our executable stand-in for a static %
% |
|
@timtuxworth still need your approval I think. |
|
Can we see these warnings on our local machines but not in CI. It would be helpful to replicate them in automated testing ardupilot/.github/workflows/test_scripting.yml Lines 28 to 29 in 94d58a3 |
Summary
Fixes "_ hints at private" warnings in lua attitude module
Classification & Testing (check all that apply and add your own)
Description
_ is a hint that a variable is unused. Just eliminate the
localcopy, it's pointless....