Detailed in GitHub
It use Busted to test and LuaFormatter to lint lua scripts!
docker run --rm -t -v "$PWD:/data" shuehchoulu/lua-cook:${VERSION} lua-project.json
You must give it configuration JSON file, for example lua-project.json:
{
"files": ["src", "test"], // folders include lua scripts
"test": { // configuration for testing
"folders": ["test"], // needed folders
"pattern": ".spec",
"helper": "test/helpers.lua",
"output": "gtest",
"verbose": true
},
"format": { // configuration for formatting/linting
"column-limit": 120,
"single-quote-to-double-quote": true,
"keep-simple-control-block-one-line": true,
"no-keep-simple-function-one-line": true,
"spaces-inside-table-braces": true
}
}
Excepts commented fields, all the fields are directly pass to the dependency(LuaFormatter/Busted).
In additionally, you can do specific action by passing second argument.
docker run --rm -t -v "$PWD:/data" shuehchoulu/lua-cook:${VERSION} lua-project.json test --t_verbose
You can pass custom argument by command line without configuration file.
The only different with Busted was all argument must prefix with t_, for example:
--t_verbose--t_pattern=_specCustom argument must prefix with f_.
docker run --rm -t -v "$PWD:/data" shuehchoulu/lua-cook:${VERSION} lua-project.json format --f_in-place
===== Formatting =====
... config data ...
formatting: /data/src/main.lua
=== Success ===
--in-place Reformats in-place$ docker run --rm -t -v "$PWD:/data" shuehchoulu/lua-cook:${VERSION} lua-project.json format --f_check
===== Formatting =====
... config data ...
formatting: /data/src/main.lua
=== Success ===
--check Non-zero return if formatting is neededContent type
Image
Digest
sha256:32540e333…
Size
9.5 MB
Last updated
almost 4 years ago
docker pull shuehchoulu/lua-cook:v0.1