Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Scripting: fix outstanding luacheck issues #28931

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

IamPete1
Copy link
Member

This fixes all the lua check issues, no more -- luacheck: only 0. There are still lots of lua language server issues that we should fix.....

@rmackay9
Copy link
Contributor

I'm happy with the changes affecting scripts I'm responsible for

Copy link
Contributor

@tpwrules tpwrules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall, some tiny nits attached.

libraries/AP_Scripting/applets/Script_Controller.lua Outdated Show resolved Hide resolved
Comment on lines -42 to -47
-- clear vars we don't need anymore
slew_down_time = nil
slew_up_time = nil
pwm_range = nil


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could enclose the above in a do ... end block to create a new scope and actually destroy them but since they are just numbers it is probably a net negative.

libraries/AP_Scripting/examples/mission-load.lua Outdated Show resolved Hide resolved
Copy link
Contributor

@tpwrules tpwrules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mangled the comment syntax, sorry.

libraries/AP_Scripting/applets/Script_Controller.lua Outdated Show resolved Hide resolved
@IamPete1 IamPete1 dismissed tpwrules’s stale review December 23, 2024 18:58

Does work currently.

@IamPete1 IamPete1 requested a review from tpwrules December 23, 2024 18:58
Copy link
Contributor

@tpwrules tpwrules left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right. Don't need the additional --, just the ]].

LGTM overall, thanks.

Hopefully exposing more code to the checker doesn't lead to too many more issues as it changes. Maybe we need to pin it :)

@@ -474,11 +464,10 @@ function do_knife_edge(arg1,arg2)
if not running then
running = true
height_PI.reset()
knife_edge_s = now
knife_edge_ms = now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is in seconds

tridge
tridge previously requested changes Dec 24, 2024
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Scipting_Controller.lua and sport_aerobatics.lua should be broken out for @Hwurzburg to look at

@IamPete1
Copy link
Member Author

I think the Scipting_Controller.lua and sport_aerobatics.lua should be broken out for @Hwurzburg to look at

Changes to those two files have been dropped.

@rmackay9 rmackay9 dismissed tridge’s stale review December 24, 2024 02:26

Tridge's request to remove aerobatics has been addressed

@tpwrules tpwrules merged commit 0dbbb87 into ArduPilot:master Dec 24, 2024
100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants