[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang

Fix linters (#19)

* fix selene

* chore(ci): pin stylua version

Changed files
+6 -5
.github
workflows
lua
+1
.github/workflows/ci.yml
··· 10 10 - uses: JohnnyMorganz/stylua-action@1.0.0 11 11 with: 12 12 token: ${{ secrets.GITHUB_TOKEN }} 13 + version: 0.14.0 13 14 args: --check . 14 15 15 16 lint:
+4 -4
lua/gopher/comment.lua
··· 4 4 local comment, ns = nil, nil 5 5 6 6 ns = ts_utils.get_package_node_at_pos(row, col) 7 - if ns ~= nil and ns ~= {} then 7 + if ns ~= nil then 8 8 comment = "// Package " .. ns.name .. " provides " .. ns.name 9 9 return comment, ns 10 10 end 11 11 12 12 ns = ts_utils.get_struct_node_at_pos(row, col) 13 - if ns ~= nil and ns ~= {} then 13 + if ns ~= nil then 14 14 comment = "// " .. ns.name .. " " .. ns.type .. " " 15 15 return comment, ns 16 16 end 17 17 18 18 ns = ts_utils.get_func_method_node_at_pos(row, col) 19 - if ns ~= nil and ns ~= {} then 19 + if ns ~= nil then 20 20 comment = "// " .. ns.name .. " " .. ns.type .. " " 21 21 return comment, ns 22 22 end 23 23 24 24 ns = ts_utils.get_interface_node_at_pos(row, col) 25 - if ns ~= nil and ns ~= {} then 25 + if ns ~= nil then 26 26 comment = "// " .. ns.name .. " " .. ns.type .. " " 27 27 return comment, ns 28 28 end
+1 -1
lua/gopher/struct_tags.lua
··· 7 7 local function modify(...) 8 8 local fpath = vim.fn.expand "%" ---@diagnostic disable-line: missing-parameter 9 9 local ns = ts_utils.get_struct_node_at_pos(unpack(vim.api.nvim_win_get_cursor(0))) 10 - if ns == nil or ns == {} then 10 + if ns == nil then 11 11 return 12 12 end 13 13