From 5d6546d41419f4a02e9201d99090b63da1c4bfa1 Mon Sep 17 00:00:00 2001 From: Ade Attwood Date: Sat, 6 Aug 2022 15:02:42 +0100 Subject: [PATCH] ci: add luacheck --- .github/workflows/ci.yml | 16 ++++++++++++++++ .luacheckrc | 6 ++++++ plugin/ivy.lua | 1 + 3 files changed, 23 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9c28e1..04b65dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,22 @@ jobs: with: args: conventional-tools commitlint -l1 + luacheck: + name: Luacheck + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install luarocks + run: sudo apt update && sudo apt install -y luarocks + + - name: Install luacheck + run: sudo luarocks install luacheck + + - name: Run luacheck + run: luacheck . + test: name: Build and test runs-on: ubuntu-latest diff --git a/.luacheckrc b/.luacheckrc index 68cf318..337ac8e 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -9,4 +9,10 @@ self = false -- Global objects defined by the C code read_globals = { "vim", + + "it", + "after", + "after_each", + "before", + "before_each", } diff --git a/plugin/ivy.lua b/plugin/ivy.lua index bf1262b..e5f1233 100644 --- a/plugin/ivy.lua +++ b/plugin/ivy.lua @@ -4,6 +4,7 @@ local libivy = require "ivy.libivy" -- Put the controller in to the vim global so we can access it in mappings -- better without requires. You can call controller commands like `vim.ivy.xxx`. +-- luacheck: ignore vim.ivy = controller vim.api.nvim_create_user_command("IvyAg", function()