formatter
1 概述
lua 代码格式化工具。
2 安装
该程序依赖 checks。
luarocks install checks luarocks install Formatter
3 使用
luaformatter [option] [files]
可用参数:
-a, --autosave Flush formatted Lua in given file instead of stdout. -s, --spaces (default 2) Spaces to use as indentation. -t, --tabs (default 0) Tabulation(s) to use as indentation. -d, --delimiter (default unix) Type of new line to detect and use while formatting: * unix: '\n' LF Line feed. * windows: '\r\n' CR+LF * mac: '\r' CR Carriage Return of Macs before OSX. -h, --help This help. [files] Files to format.
示例:
luaformatter -a -s 4 test.lua