exercism / lua

Exercism exercises in Lua.
https://exercism.org/tracks/lua
MIT License
41 stars 57 forks source link

Check formatting #432

Closed ryanplusplus closed 10 months ago

ryanplusplus commented 11 months ago

This updates the formatting configuration a bit, applies it to all Lua files, then adds a GitHub Actions workflow to verify that all files are formatted.

I'm not in love with the formatter as it doesn't seem to allow line breaks (or lack of line breaks) to be retained. I disabled it in some specs to improve readability, but was able to keep it enabled in most places.

I'm open to suggestions if anyone knows a better formatter. I usually use the metalua-derived formatter, but it really only handles indentation.

I'm also okay if we want to keep the formatter configuration as a reference but not require the code to match the output of the formatter.

imolein commented 10 months ago

LuaFormatter is not perfect, but the best I found so far in the last years (imo). I used StyLua before, but it has very few configuration options.