docs: update make lint output (#4309)

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
罗泽轩 2021-05-27 00:58:43 +08:00 committed by GitHub
parent f7c6f4fff7
commit 3ccc5b8b82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,39 +103,27 @@ Once we've discussed your changes and you've got your code ready, make sure that
$ luarocks install luacheck $ luarocks install luacheck
# check source code # check source code
$ make lint $ make lint
luacheck -q lua ./utils/check-lua-code-style.sh
Total: 0 warnings / 0 errors in 74 files + luacheck -q apisix t/lib
./utils/lj-releng \ Total: 0 warnings / 0 errors in 146 files
apisix/*.lua \ + find apisix -name *.lua ! -wholename apisix/cli/ngx_tpl.lua -exec ./utils/lj-releng {} +
apisix/admin/*.lua \ + grep -E ERROR.*.lua: /tmp/check.log
apisix/core/*.lua \ + true
apisix/http/*.lua \ + [ -s /tmp/error.log ]
apisix/http/router/*.lua \ ./utils/check-test-code-style.sh
apisix/plugins/*.lua \ + find t -name '*.t' -exec grep -E '\-\-\-\s+(SKIP|ONLY|LAST|FIRST)$' '{}' +
apisix/plugins/grpc-transcode/*.lua \ + true
apisix/plugins/limit-count/*.lua > \ + '[' -s /tmp/error.log ']'
/tmp/check.log 2>&1 || (cat /tmp/check.log && exit 1) + find t -name '*.t' -exec ./utils/reindex '{}' +
+ grep done. /tmp/check.log
+ true
+ '[' -s /tmp/error.log ']'
``` ```
The `lj-releng` will be downloaded automatically by `make lint` if not exists. The `lj-releng` and `reindex` will be downloaded automatically by `make lint` if not exists.
* test case style * test case style
* Use tool to check your test case style statically by command, eg: `reindex t/admin/*.t`. * Use tool to check your test case style statically by command, eg: `make lint`.
```shell
# install `reindex` first before run it
# wget https://raw.githubusercontent.com/iresty/openresty-devel-utils/master/reindex
# ./reindex test cases
$ reindex t/admin/*.t
reindex: t/plugin/example.t: skipped. # No changes needed
reindex: t/plugin/fault-injection.t: done. # updated
reindex: t/plugin/grpc-transcode.t: skipped.
... ...
reindex: t/plugin/udp-logger.t: done.
reindex: t/plugin/zipkin.t: skipped.
```
* By the way, we can download "reindex" to another path and add this path to "PATH" environment.
* When the test file is too large, for example > 800 lines, you should split it to a new file. * When the test file is too large, for example > 800 lines, you should split it to a new file.
Please take a look at `t/plugin/limit-conn.t` and `t/plugin/limit-conn2.t`. Please take a look at `t/plugin/limit-conn.t` and `t/plugin/limit-conn2.t`.