Skip to content

Commit e700cf9

Browse files
committed
Attach zizmor on dependabot.{yml,yaml} and action.yml as well
1 parent 90f66f8 commit e700cf9

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

lsp/zizmor.lua

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,18 @@ return {
1717

1818
-- `root_dir` ensures that the LSP does not attach to all yaml files
1919
root_dir = function(bufnr, on_dir)
20-
local parent = vim.fs.dirname(vim.api.nvim_buf_get_name(bufnr))
20+
local bufname = vim.api.nvim_buf_get_name(bufnr)
21+
local parent = vim.fs.dirname(bufname)
2122
if
2223
vim.endswith(parent, '/.github/workflows')
2324
or vim.endswith(parent, '/.forgejo/workflows')
2425
or vim.endswith(parent, '/.gitea/workflows')
26+
or (vim.endswith(bufname, "/.github/dependabot.yml") or vim.endswith(bufname, "/.github/dependabot.yaml"))
27+
or vim.endswith(bufname, 'actions.yml') -- Composite actions can live in any repository subdirectory
2528
then
2629
on_dir(parent)
2730
end
2831
end,
29-
handlers = {
30-
['actions/readFile'] = function(_, result)
31-
if type(result.path) ~= 'string' then
32-
return nil, nil
33-
end
34-
local file_path = vim.uri_to_fname(result.path)
35-
if vim.fn.filereadable(file_path) == 1 then
36-
local f = assert(io.open(file_path, 'r'))
37-
local text = f:read('*a')
38-
f:close()
39-
40-
return text, nil
41-
end
42-
return nil, nil
43-
end,
44-
},
4532
init_options = {}, -- needs to be present https://github.com/neovim/nvim-lspconfig/pull/3713#issuecomment-2857394868
4633
capabilities = {
4734
workspace = {

0 commit comments

Comments
 (0)