From d65884b182f48a69a69cae296b1f8e5b43fd4774 Mon Sep 17 00:00:00 2001 From: Smirnov Oleksandr Date: Thu, 22 Sep 2022 18:18:50 +0300 Subject: [PATCH] Fix linters (#19) * fix selene * chore(ci): pin stylua version --- .github/workflows/ci.yml | 1 + lua/gopher/comment.lua | 8 ++++---- lua/gopher/struct_tags.lua | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b78986..b1be903 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ jobs: - uses: JohnnyMorganz/stylua-action@1.0.0 with: token: ${{ secrets.GITHUB_TOKEN }} + version: 0.14.0 args: --check . lint: diff --git a/lua/gopher/comment.lua b/lua/gopher/comment.lua index 3991651..6810678 100644 --- a/lua/gopher/comment.lua +++ b/lua/gopher/comment.lua @@ -4,25 +4,25 @@ local function generate(row, col) local comment, ns = nil, nil ns = ts_utils.get_package_node_at_pos(row, col) - if ns ~= nil and ns ~= {} then + if ns ~= nil then comment = "// Package " .. ns.name .. " provides " .. ns.name return comment, ns end ns = ts_utils.get_struct_node_at_pos(row, col) - if ns ~= nil and ns ~= {} then + if ns ~= nil then comment = "// " .. ns.name .. " " .. ns.type .. " " return comment, ns end ns = ts_utils.get_func_method_node_at_pos(row, col) - if ns ~= nil and ns ~= {} then + if ns ~= nil then comment = "// " .. ns.name .. " " .. ns.type .. " " return comment, ns end ns = ts_utils.get_interface_node_at_pos(row, col) - if ns ~= nil and ns ~= {} then + if ns ~= nil then comment = "// " .. ns.name .. " " .. ns.type .. " " return comment, ns end diff --git a/lua/gopher/struct_tags.lua b/lua/gopher/struct_tags.lua index 1d577ce..11488b0 100644 --- a/lua/gopher/struct_tags.lua +++ b/lua/gopher/struct_tags.lua @@ -7,7 +7,7 @@ local M = {} local function modify(...) local fpath = vim.fn.expand "%" ---@diagnostic disable-line: missing-parameter local ns = ts_utils.get_struct_node_at_pos(unpack(vim.api.nvim_win_get_cursor(0))) - if ns == nil or ns == {} then + if ns == nil then return end