Fix linters (#19)

* fix selene

* chore(ci): pin stylua version
This commit is contained in:
Smirnov Oleksandr 2022-09-22 18:18:50 +03:00
parent aa535e7ed1
commit d65884b182
3 changed files with 6 additions and 5 deletions

View file

@ -10,6 +10,7 @@ jobs:
- uses: JohnnyMorganz/stylua-action@1.0.0 - uses: JohnnyMorganz/stylua-action@1.0.0
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
version: 0.14.0
args: --check . args: --check .
lint: lint:

View file

@ -4,25 +4,25 @@ local function generate(row, col)
local comment, ns = nil, nil local comment, ns = nil, nil
ns = ts_utils.get_package_node_at_pos(row, col) 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 comment = "// Package " .. ns.name .. " provides " .. ns.name
return comment, ns return comment, ns
end end
ns = ts_utils.get_struct_node_at_pos(row, col) 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 .. " " comment = "// " .. ns.name .. " " .. ns.type .. " "
return comment, ns return comment, ns
end end
ns = ts_utils.get_func_method_node_at_pos(row, col) 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 .. " " comment = "// " .. ns.name .. " " .. ns.type .. " "
return comment, ns return comment, ns
end end
ns = ts_utils.get_interface_node_at_pos(row, col) 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 .. " " comment = "// " .. ns.name .. " " .. ns.type .. " "
return comment, ns return comment, ns
end end

View file

@ -7,7 +7,7 @@ local M = {}
local function modify(...) local function modify(...)
local fpath = vim.fn.expand "%" ---@diagnostic disable-line: missing-parameter 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))) 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 return
end end