Skip to content

Commit

Permalink
Fix linters (#19)
Browse files Browse the repository at this point in the history
* fix selene

* chore(ci): pin stylua version
  • Loading branch information
olexsmir authored Sep 22, 2022
1 parent 80d0659 commit 2391b70
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
- uses: JohnnyMorganz/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: 0.14.0
args: --check .

lint:
Expand Down
8 changes: 4 additions & 4 deletions lua/gopher/comment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lua/gopher/struct_tags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2391b70

Please sign in to comment.