diff --git a/.github/workflows/vader.yml b/.github/workflows/vader.yml index f2eae76..559ca1e 100644 --- a/.github/workflows/vader.yml +++ b/.github/workflows/vader.yml @@ -14,15 +14,16 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + # There exists a vint github action but it can't install the alpha + # version. vint has not been moving since 2020 and we need to use the + # alpha release since it fixed some things wrt the latest stable release. - uses: actions/setup-python@v1 - name: Install vint run: pip install --pre vim-vint - name: Lint vimscript files run: vint --warning --enable-neovim ./after ./autoload ./compiler ./ftdetect ./ftplugin ./indent ./syntax - - name: Install shellcheck - run: sudo apt-get -y install shellcheck - - name: Lint shell scripts - run: "shellcheck **/*.sh" + - uses: lunarmodules/luacheck@v1 + - uses: ludeeus/action-shellcheck@master tests: runs-on: ubuntu-latest @@ -30,21 +31,17 @@ jobs: strategy: fail-fast: false matrix: - neovim: [false, true] + editor: ["vim", "nvim"] steps: - uses: actions/checkout@v2 - - name: Setup Vim or Neovim + - name: Setup ${{ matrix.editor }} uses: rhysd/action-setup-vim@v1 id: vim with: - neovim: ${{ matrix.neovim }} + neovim: ${{ matrix.editor == 'nvim' }} - name: Run Vader unit tests run: | - if [ "${{ matrix.neovim }}" = "true" ]; then - TESTVIM=nvim - else - TESTVIM=vim - fi + TESTVIM=${{ matrix.editor }} export TESTVIM ./test/run-tests.sh diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..d87de4b --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,17 @@ +-- vim: ft=lua tw=80 + +-- Global objects defined by the C code +read_globals = { + vim = { + other_fields = true, + fields = { + 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