diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..413158b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,30 @@ +--- +name: Lint + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Luacheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Setup + run: | + sudo apt-get update + sudo apt-get install luarocks -y + sudo luarocks install luacheck + + - name: Lint + run: luacheck lua/ --globals vim diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 0000000..3dff5c3 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -0,0 +1,28 @@ +--- +name: lua_ls-typecheck + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Type Check Code Base + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v5 + - uses: stevearc/nvim-typecheck-action@v2 + with: + path: lua + level: Warning + configpath: ".luarc.json" diff --git a/.luarc.json b/.luarc.json index 68da2f2..3826102 100644 --- a/.luarc.json +++ b/.luarc.json @@ -5,5 +5,11 @@ }, "type": { "checkTableShape": true - } + }, + "diagnostics.globals": [ + "describe", + "it", + "before_each", + "after_each" + ] } diff --git a/test/utils/helpers.lua b/test/utils/helpers.lua index 03cb5bd..13db95f 100644 --- a/test/utils/helpers.lua +++ b/test/utils/helpers.lua @@ -1,5 +1,4 @@ local helpers = require("nvim-test.helpers") -local command = helpers.api.nvim_command local system = helpers.fn.system local M = helpers