Skip to content

Commit 49fa005

Browse files
test: add linting stage
Statically validate module code and tests with luacheck [1]. Run linting stage as a first step of regression tests. 1. https://github.com/tarantool/luacheck Part of tarantool/tarantool#7726
1 parent 178426b commit 49fa005

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

.github/workflows/reusable_testing.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ jobs:
2828
# dependencies when migrating to other OS version.
2929
run: sudo dpkg -i tarantool*.deb
3030

31+
- run: make lint
32+
3133
- run: make test

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
tarantool-version: ${{ matrix.tarantool }}
1919

20+
- name: Run static analysis
21+
run: make lint
22+
2023
- name: Run regression testing
2124
run: make test
2225

.luacheckrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include_files = {'**/*.lua', '*.luacheckrc', '*.rockspec'}
2+
exclude_files = {'.rocks/', 'tmp/', 'build/'}
3+
max_line_length = 120
4+
redefined = false

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ endif
55

66
.PHONY: all
77
all:
8-
@echo "Available commands: .rocks, test, perf, clean"
8+
@echo "Available commands: .rocks, lint, test, perf, clean"
99

1010
.rocks: rockspecs/checks-scm-1.rockspec
1111
$(TTCTL) rocks make
12+
$(TTCTL) rocks install luacheck 0.26.0
1213
$(TTCTL) rocks install luatest 0.5.7
1314

15+
.PHONY: lint
16+
lint: .rocks
17+
.rocks/bin/luacheck .
18+
1419
.PHONY: test
1520
test: .rocks
1621
.rocks/bin/luatest -c -v ./test.lua

0 commit comments

Comments
 (0)