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)) local specs = generator.generate(p, bg, generator.get_global_config("forestbones", bg))
return lush.extends({ specs }).with(function() return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return { return {
Statement { fg = p.leaf, gui = "bold" }, Statement { fg = p.leaf, gui = "bold" },
PreProc { fg = p.sky }, PreProc { fg = p.sky },
Type { fg = p.water }, Type { fg = p.water },
} }
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end) end)

View File

@@ -8,19 +8,27 @@ local specs = generator.generate(p, bg, generator.get_global_config("neobones",
if bg == "light" then if bg == "light" then
return lush.extends({ specs }).with(function() return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return { return {
helpHyperTextJump { fg = hsluv "#195174" }, -- --link-color helpHyperTextJump { fg = hsluv "#195174" }, -- --link-color
helpOption { helpHyperTextJump }, helpOption { helpHyperTextJump },
markdownUrl { helpHyperTextJump }, markdownUrl { helpHyperTextJump },
} }
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end) end)
else else
return lush.extends({ specs }).with(function() return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return { return {
FloatBorder { specs.FloatBorder, fg = hsluv "#203f57" }, -- --border-color FloatBorder { specs.FloatBorder, fg = hsluv "#203f57" }, -- --border-color
helpHyperTextJump { fg = hsluv "#8ec77e" }, -- --link-color helpHyperTextJump { fg = hsluv "#8ec77e" }, -- --link-color
helpOption { helpHyperTextJump }, helpOption { helpHyperTextJump },
markdownUrl { helpHyperTextJump }, markdownUrl { helpHyperTextJump },
} }
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end) end)
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")) local specs = generator.generate(p.derived, "dark", generator.get_global_config("nordbones", "dark"))
return lush.extends({ specs }).with(function() return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return { return {
Number { fg = p.base.nord7, gui = "italic" }, Number { fg = p.base.nord7, gui = "italic" },
Identifer { fg = p.derived.fg }, Identifer { fg = p.derived.fg },
@@ -12,4 +14,6 @@ return lush.extends({ specs }).with(function()
Statement { fg = p.base.nord9 }, Statement { fg = p.base.nord9 },
Type { fg = p.base.nord10 }, Type { fg = p.base.nord10 },
} }
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end) 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)) local specs = generator.generate(p, bg, generator.get_global_config("rosebones", bg))
return lush.extends({ specs }).with(function() return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return { return {
Statement { fg = p.leaf }, Statement { fg = p.leaf },
Special { fg = p.water }, Special { fg = p.water },
Type { fg = p.text }, Type { fg = p.text },
} }
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end) 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)) local specs = generator.generate(p, bg, generator.get_global_config("tokyobones", bg))
return lush.extends({ specs }).with(function() return lush.extends({ specs }).with(function()
---@diagnostic disable: undefined-global
-- selene: allow(undefined_variable)
return { return {
Statement { fg = p.blossom, gui = "bold" }, Statement { fg = p.blossom, gui = "bold" },
Number { fg = p.sky }, Number { fg = p.sky },
@@ -15,4 +17,6 @@ return lush.extends({ specs }).with(function()
PreProc { fg = p.blossom }, PreProc { fg = p.blossom },
Special { fg = p.water }, Special { fg = p.water },
} }
-- selene: deny(undefined_variable)
---@diagnostic enable: undefined-global
end) end)

View File

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

View File

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

View File

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