0.0.1 • Published 4 years ago
@zamiell/zamfmt v0.0.1
zamfmt
zamfmt
is a pretty-printer for Lua code, written in TypeScript. It is inspired by gofmt for Go, rustfmt for Rust, Prettier for JavaScript, Black for Python, and so on.
The idea of zamfmt
is that you set up your text editor to automatically format your Lua code whenever you press Ctrl + s
to save the file. This bypasses the boring minutia of formatting a new code block, saving you precious seconds. And as the days turn to weeks, these seconds add up to save you a metric shit-ton of time.
Andrew Gerrand summarizes on the Go blog why automated code formatting is amazing. In short, auto-formatted code is:
- easier to write: never worry about minor formatting concerns while hacking away
- easier to read: when all code looks the same, you need not mentally convert others' formatting style into something you can understand
- easier to maintain: mechanical changes to the source don't cause unrelated changes to the file's formatting; diffs show only the real changes
- uncontroversial: never have a debate about spacing or brace position ever again!
Style
See the style documentation.
Installation
- Nowadays, most people use either Visual Studio Code (VSCode) or ZeroBrane Studio to code Lua.
- For Visual Studio Code:
- Install the zam-fmt extension.
- That's it. Now Lua code will be automatically formatted on save.
- For ZeroBrane Studio:
- TODO
0.0.1
4 years ago