diff --git a/.github/workflows/vader.yml b/.github/workflows/vader.yml index 4dd97a2..559ca1e 100644 --- a/.github/workflows/vader.yml +++ b/.github/workflows/vader.yml @@ -22,6 +22,7 @@ jobs: run: pip install --pre vim-vint - name: Lint vimscript files run: vint --warning --enable-neovim ./after ./autoload ./compiler ./ftdetect ./ftplugin ./indent ./syntax + - uses: lunarmodules/luacheck@v1 - uses: ludeeus/action-shellcheck@master tests: diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..d5ec9fa --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,20 @@ +-- vim: ft=lua tw=80 + +-- Global objects defined by the C code +read_globals = { + vim = { + filetype = { + fields = { + add = {}, + match = {}, + } + }, + b = { + fields = { + epuppet_subtype = { + read_only=false, + } + } + } + } +} diff --git a/ftdetect/puppet.lua b/ftdetect/puppet.lua index 021abc8..11b51a5 100644 --- a/ftdetect/puppet.lua +++ b/ftdetect/puppet.lua @@ -5,8 +5,8 @@ vim.filetype.add({ extension = { epp = function(path, bufnr) - path_wo_epp = path:sub(1,-5) - matched = vim.filetype.match({ buf = bufnr, filename = path_wo_epp }) + local path_wo_epp = path:sub(1,-5) + local matched = vim.filetype.match({ buf = bufnr, filename = path_wo_epp }) if matched ~= nil and matched ~= 'mason' then vim.b.epuppet_subtype = matched end