build: exclude stylua ignore comments from readme

This commit is contained in:
Folke Lemaitre 2025-10-09 10:41:06 +02:00
commit 9f559d0e9d
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -61,7 +61,11 @@ end
---@return string
function M.extract(file, pattern)
local init = Util.read_file(file)
return assert(init:match(pattern))
local ret = assert(init:match(pattern)) --[[@as string]]
local lines = vim.tbl_filter(function(line)
return not line:find("^%s*%-%-%s*stylua%s*:%s*ignore%s*$")
end, vim.split(ret, "\n"))
return table.concat(lines, "\n")
end
---@return ReadmeBlock