Skip to content

Commit 9426c55

Browse files
ci: add lint action
1 parent d492f04 commit 9426c55

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Check scripts with luacheck
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
luacheck:
7+
runs-on: ubuntu-18.04
8+
strategy:
9+
matrix:
10+
lua:
11+
- ver: 5.1.5
12+
std: lua51
13+
- ver: 5.2.4
14+
std: lua52c
15+
- ver: luajit-2.0.5
16+
std: luajit
17+
steps:
18+
- uses: actions/checkout@master
19+
- uses: leafo/gh-actions-lua@v5
20+
with:
21+
luaVersion: ${{matrix.lua.ver}}
22+
- uses: leafo/gh-actions-luarocks@v2
23+
- name: Install luacheck
24+
run: luarocks install luacheck
25+
- name: Lint with luacheck
26+
run: luacheck --std ${{matrix.lua.std}} .

.luacheckrc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
-- luacheck: ignore 131
22

3-
std = 'lua52'
3+
std = 'lua52c'
44

5-
globals = {'mp'}
5+
read_globals = {'mp'}
66

77
allow_defined_top = true
88

99
max_line_length = 80
1010

1111
max_comment_line_length = false
1212

13+
include_files = {
14+
'clipshot.lua',
15+
'misc.lua',
16+
'open-dialog/*.lua'
17+
}
18+
1319
files['open-dialog/zenity.lua'] = {
1420
globals = {'table.merge'}
1521
}

0 commit comments

Comments
 (0)