Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add lua lint check #149

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions .github/workflows/vader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,34 @@ 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
needs: lint
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
17 changes: 17 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -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,
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions ftdetect/puppet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading