integrate selene linting

This commit is contained in:
Michael Chris Lopez
2021-10-29 15:00:22 +08:00
parent c441a98b80
commit a436a4cfd2
10 changed files with 40 additions and 1 deletions

View File

@@ -6,9 +6,13 @@ local p = require("forestbones.palette")[bg]
local specs = generator.generate(p, bg, generator.get_global_config("forestbones", bg))
return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return {
Statement { fg = p.leaf, gui = "bold" },
PreProc { fg = p.sky },
Type { fg = p.water },
}
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end)

View File

@@ -8,19 +8,27 @@ local specs = generator.generate(p, bg, generator.get_global_config("neobones",
if bg == "light" then
return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return {
helpHyperTextJump { fg = hsluv "#195174" }, -- --link-color
helpOption { helpHyperTextJump },
markdownUrl { helpHyperTextJump },
}
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end)
else
return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return {
FloatBorder { specs.FloatBorder, fg = hsluv "#203f57" }, -- --border-color
helpHyperTextJump { fg = hsluv "#8ec77e" }, -- --link-color
helpOption { helpHyperTextJump },
markdownUrl { helpHyperTextJump },
}
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end)
end

View File

@@ -5,6 +5,8 @@ local p = require "nordbones.palette"
local specs = generator.generate(p.derived, "dark", generator.get_global_config("nordbones", "dark"))
return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return {
Number { fg = p.base.nord7, gui = "italic" },
Identifer { fg = p.derived.fg },
@@ -12,4 +14,6 @@ return lush.extends({ specs }).with(function()
Statement { fg = p.base.nord9 },
Type { fg = p.base.nord10 },
}
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end)

View File

@@ -6,9 +6,13 @@ local p = require("rosebones.palette")[bg]
local specs = generator.generate(p, bg, generator.get_global_config("rosebones", bg))
return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return {
Statement { fg = p.leaf },
Special { fg = p.water },
Type { fg = p.text },
}
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end)

View File

@@ -6,6 +6,8 @@ local p = require("tokyobones.palette")[bg]
local specs = generator.generate(p, bg, generator.get_global_config("tokyobones", bg))
return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return {
Statement { fg = p.blossom, gui = "bold" },
Number { fg = p.sky },
@@ -15,4 +17,6 @@ return lush.extends({ specs }).with(function()
PreProc { fg = p.blossom },
Special { fg = p.water },
}
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end)

View File

@@ -21,6 +21,7 @@ local function generate(p, opt)
end
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
-- stylua: ignore start
local base = lush(function()
return {
@@ -375,6 +376,7 @@ local function generate(p, opt)
}
end)
-- stylua: ignore end
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
local specs = {
@@ -385,11 +387,13 @@ local function generate(p, opt)
table.insert(
specs,
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
lush(function()
return {
NormalNC { base.Normal, bg = base.Normal.bg.li(2) }, -- normal text in non-current windows
}
end)
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
)
end
@@ -399,6 +403,7 @@ local function generate(p, opt)
table.insert(
specs,
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
lush(function()
return {
LspDiagnosticsDefaultError { base.DiagnosticError }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
@@ -427,6 +432,7 @@ local function generate(p, opt)
LspDiagnosticsSignHint { base.DiagnosticSignHint }, -- Used for "Hint" signs in sign column
}
end)
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
)
end

View File

@@ -2,7 +2,7 @@ local M = {}
local function concat_config(prefix, suffixes)
local config = {}
for i, suffix in ipairs(suffixes) do
for _i, suffix in ipairs(suffixes) do
config[suffix] = vim.g[prefix .. "_" .. suffix]
end
return config

View File

@@ -21,6 +21,7 @@ local function generate(p, opt)
end
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
-- stylua: ignore start
local base = lush(function()
return {
@@ -375,6 +376,7 @@ local function generate(p, opt)
}
end)
-- stylua: ignore end
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
local specs = {
@@ -385,11 +387,13 @@ local function generate(p, opt)
table.insert(
specs,
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
lush(function()
return {
NormalNC { base.Normal, bg = base.Normal.bg.da(2) }, -- normal text in non-current windows
}
end)
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
)
end
@@ -399,6 +403,7 @@ local function generate(p, opt)
table.insert(
specs,
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
lush(function()
return {
LspDiagnosticsDefaultError { base.DiagnosticError }, -- Used as the base highlight group. Other LspDiagnostic highlights link to this by default (except Underline)
@@ -427,6 +432,7 @@ local function generate(p, opt)
LspDiagnosticsSignHint { base.DiagnosticSignHint }, -- Used for "Hint" signs in sign column
}
end)
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
)
end

2
nvim_selene.toml Normal file
View File

@@ -0,0 +1,2 @@
[vim]
any = true

1
selene.toml Normal file
View File

@@ -0,0 +1 @@
std="lua51+nvim_selene"