Coding 2022-09-03
I got a bunch of tooling more-or-less working for developing with Lua. We'll see if it all actually works out, because I was just focusing on getting things to more-or-less pass. Right now, I'm trying out:
- sphinx-lua with Furo, and using Invoke instead of the makefiles. I haven't actually tried to document code with this yet, and if it doesn't work, I'll just switch to LDoc. Getting sphinx-lua to run right took some weird additions to the requirements file, so I'm not super-attached to it yet, but given the ability to use Furo's dark mode, I'll try to take it.
- lunitx and LuaCov. Notes on getting this working: I had to add LUA_INIT=require 'luacov' to the environment for the lunit.sh call, because I didn't see another way to make it load the module, but it all seemed to work, once I created a proper .luacov file. Update: while I was writing the stuff down below, I realized I could just call lua -llunitx tests/*, so I did that instead, because I'm not sure what the wrapper does in comparison, and I'd rather call Lua directly I think? Late-breaking update: That did weird stuff to coverage, so I switched it back. Not sure what was going on there... The other part of it was getting lunitx tests happy with how Luacheck wants me to write modules. Here's the pattern that I settled on:
local t = require "lunit"
local m = t.TEST_CASE "<test file name>"
function m.test_etc() end
return m
With this, I'm not creating any globals, and it's all working through lunitx's compatibility layers, so it can discover the tests. Now, I need to get to writing some code so I can test it.
Some of that code may end up being random bits of scaffolding, because, Lua. Anyway, I feel like I've written enough, and I don't want to delay this post any.
Good night.