diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7ed9bc..6a325da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,6 +35,19 @@ jobs: - name: Run luacheck run: luacheck . + stylua: + name: StyLua + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Run stylua + uses: JohnnyMorganz/stylua-action@1.0.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --check . + clang-format: name: Clang Format runs-on: ubuntu-latest diff --git a/lua/ivy/controller.lua b/lua/ivy/controller.lua index 0fe3b5c..306acb0 100644 --- a/lua/ivy/controller.lua +++ b/lua/ivy/controller.lua @@ -12,7 +12,7 @@ controller.run = function(name, items, callback) window.initialize() - window.set_items { { content = "-- Loading ---" } } + window.set_items { { content = "-- Loading ---" } } vim.api.nvim_buf_set_name(window.get_buffer(), name) controller.input "" @@ -31,7 +31,7 @@ end controller.update = function(text) vim.schedule(function() window.set_items(controller.items(text)) - vim.cmd("syntax clear IvyMatch") + vim.cmd "syntax clear IvyMatch" vim.cmd("syntax match IvyMatch '[(" .. text .. ")]'") end) end diff --git a/lua/ivy/libivy.lua b/lua/ivy/libivy.lua index 0377b2e..f1267f5 100644 --- a/lua/ivy/libivy.lua +++ b/lua/ivy/libivy.lua @@ -19,8 +19,8 @@ libivy.ivy_init = function(dir) ivy_c.ivy_init(dir) end -libivy.ivy_cwd = function () - return ffi.string(ivy_c.ivy_cwd()) +libivy.ivy_cwd = function() + return ffi.string(ivy_c.ivy_cwd()) end libivy.ivy_match = function(pattern, text) diff --git a/lua/ivy/libivy_test.lua b/lua/ivy/libivy_test.lua index 519361a..4f4426f 100644 --- a/lua/ivy/libivy_test.lua +++ b/lua/ivy/libivy_test.lua @@ -8,11 +8,11 @@ it("should run a simple match", function(t) end end) -it("should find a dot file", function (t) +it("should find a dot file", function(t) local current_dir = libivy.ivy_cwd() - local matches = libivy.ivy_files("ci.yml", current_dir); + local matches = libivy.ivy_files("ci.yml", current_dir) if matches ~= ".github/workflows/ci.yml\n" then t.error("Invalid matches: " .. matches) end -end); +end) diff --git a/lua/ivy/window.lua b/lua/ivy/window.lua index 0a45a46..ea94ec3 100644 --- a/lua/ivy/window.lua +++ b/lua/ivy/window.lua @@ -107,7 +107,7 @@ window.set_items = function(items) -- Display no items text if there are no items to dispaly if #items == 0 then - items = { { content = "-- No Items --" } } + items = { { content = "-- No Items --" } } end local items_length = #items