Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions lsp/zizmor.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---@brief
---
--- https://github.com/zizmorcore/zizmor
---
--- Zizmor language server.
---
--- `zizmor` can be installed by following the instructions [here](https://docs.zizmor.sh/installation/).
---
--- The default `cmd` assumes that the `zizmor` binary can be found in `$PATH`.
---
--- See `zizmor`'s [documentation](https://docs.zizmor.sh/) for additional documentation.

---@type vim.lsp.Config
return {
cmd = { 'zizmor', '--lsp' },
filetypes = { 'yaml' },

-- `root_dir` ensures that the LSP does not attach to all yaml files
root_dir = function(bufnr, on_dir)
local bufname = vim.api.nvim_buf_get_name(bufnr)
local parent = vim.fs.dirname(bufname)
if
vim.endswith(parent, '/.github/workflows')
or vim.endswith(parent, '/.forgejo/workflows')
or vim.endswith(parent, '/.gitea/workflows')
Comment thread
peytondmurray marked this conversation as resolved.
or (vim.endswith(bufname, '/.github/dependabot.yml') or vim.endswith(bufname, '/.github/dependabot.yaml'))
or vim.endswith(bufname, 'action.yml') -- Composite actions can live in any repository subdirectory
then
on_dir(parent)
end
end,
init_options = {}, -- needs to be present https://github.com/neovim/nvim-lspconfig/pull/3713#issuecomment-2857394868
capabilities = {
workspace = {
didChangeWorkspaceFolders = {
dynamicRegistration = true,
},
},
},
}
Loading