Page MenuHomeFreeBSD

makesyscalls.lua: Make more luaish
ClosedPublic

Authored by imp on Apr 20 2023, 3:58 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 2 2024, 5:20 PM
Unknown Object (File)
May 2 2024, 5:04 PM
Unknown Object (File)
May 2 2024, 2:24 PM
Unknown Object (File)
May 2 2024, 1:20 PM
Unknown Object (File)
Mar 21 2024, 4:44 AM
Unknown Object (File)
Mar 17 2024, 8:18 AM
Unknown Object (File)
Mar 14 2024, 5:49 PM
Unknown Object (File)
Mar 14 2024, 5:49 PM
Subscribers
None

Details

Summary

x["y"] can be written as x.y, which looks better and is a more typical
lua idiom.

Sponsored by: Netflix

Test Plan

cd sys/kern
make sysent
git diff

should show nothing (or only changes to sys/tools/makesyscalls.lua)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Apr 20 2023, 3:58 AM
imp created this revision.
imp edited the test plan for this revision. (Show Details)

Seems reasonable to me; I have two requests that aren't really related to this change, though it'd be nice if you could include them or just smack them in a follow-up so that I don't conflict with your work. They're luacheck-noted issues (unknown global line and unused arg comment)

sys/tools/makesyscalls.lua
525

Can you make this local line = ... while you're at it, please?

1055

and remove the comment argument here, please

This revision is now accepted and ready to land.Apr 20 2023, 4:11 AM

Two things: 1. Mind if I do that as a followup commit? 2. Where is this luacheck obtained?

In D39709#903653, @imp wrote:

Two things: 1. Mind if I do that as a followup commit? 2. Where is this luacheck obtained?

Yeah, feel free!

iuacheck is available in ports, devel/lua-luacheck, or as the lua54-luacheck pkg. I try to keep our lua scripts luacheck clean, it has just about the right level of nagging about poor form.

This revision was automatically updated to reflect the committed changes.