From 344e33881f6b804a92975ad489e23fed6a755960 Mon Sep 17 00:00:00 2001 From: Chip Wolf Date: Fri, 26 Jun 2026 15:11:36 +0100 Subject: [PATCH] fix(ci): repair MegaLinter full-repo scan failures on main The push-event scan sets VALIDATE_ALL_CODEBASE, surfacing four blocking findings that per-file PR scans never linted: - LUA_STYLUA: reformat headless-install.lua to double-quote string style. - TYPESCRIPT_STANDARD: exclude skills/agent-audit/lib/opencode-plugin.ts, a standalone skill resource outside tsconfig.json's include (same class as the already-excluded vendored rtk.ts). - JAVASCRIPT_STANDARD: exclude skills/*.workflow.js Workflow-tool script bodies, whose top-level return/await parses as 'return' outside function. - YAML_V8R: exclude home/dot_glzr/glazewm/config.yaml; SchemaStore ships the GlazeWM v2 schema while this config is v3 (no upstream v3 schema). Co-Authored-By: Claude Opus 4.8 --- .mega-linter.yml | 18 ++++++- .../nvim/scripts/headless-install.lua | 52 ++++++++++--------- 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index a51910ab..2334d8b1 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -26,7 +26,23 @@ JSON_PRETTIER_FILTER_REGEX_EXCLUDE: "(home/.*modify_[^/]*\\.json)" # rtk.ts is vendored from https://github.com/rtk-ai/rtk and must not be modified # locally (see header comment in the file). Exclude it from ts-standard. -TYPESCRIPT_STANDARD_FILTER_REGEX_EXCLUDE: "(home/dot_config/opencode/plugins/rtk\\.ts)" +# skills/agent-audit/lib/opencode-plugin.ts is a standalone skill resource (a +# reference OpenCode plugin distributed via the skills CLI), not part of this +# repo's TS project. It is outside tsconfig.json's `include`, so ts-standard's +# parserOptions.project parse fails on it; exclude rather than pull an external +# skill example into the maintained opencode plugin project. +TYPESCRIPT_STANDARD_FILTER_REGEX_EXCLUDE: "(home/dot_config/opencode/plugins/rtk\\.ts|skills/agent-audit/lib/opencode-plugin\\.ts)" + +# *.workflow.js files are Workflow-tool script bodies: the runtime wraps them in +# an async function, so top-level `return`/`await` is valid there but parses as +# `'return' outside of function` under standardjs. Exclude them from standard. +JAVASCRIPT_STANDARD_FILTER_REGEX_EXCLUDE: "(skills/.*\\.workflow\\.js)" + +# SchemaStore matches **/glazewm/config.yaml to schemastore.org/glazewm.json, +# which is the GlazeWM v2 schema. This config targets GlazeWM v3 (restructured +# config; v3 ships no authoritative JSON schema), so v8r reports every v3 key as +# an unknown property. Exclude until SchemaStore publishes a v3 schema. +YAML_V8R_FILTER_REGEX_EXCLUDE: "(home/dot_glzr/glazewm/config\\.yaml)" REPOSITORY_KICS_ARGUMENTS: "--exclude-paths .github/workflows/e2e-install.yml" diff --git a/home/dot_config/nvim/scripts/headless-install.lua b/home/dot_config/nvim/scripts/headless-install.lua index b2562d33..292999f0 100644 --- a/home/dot_config/nvim/scripts/headless-install.lua +++ b/home/dot_config/nvim/scripts/headless-install.lua @@ -10,15 +10,15 @@ -- regardless. This script waits for the work that *does* run headless. local function log(msg) - io.stderr:write(string.format('[headless-install] %s\n', msg)) + io.stderr:write(string.format("[headless-install] %s\n", msg)) end -log('starting Lazy sync (wait=true)') -require('lazy').sync({ wait = true, show = false }) -log('Lazy sync done') +log("starting Lazy sync (wait=true)") +require("lazy").sync({ wait = true, show = false }) +log("Lazy sync done") -require('lazy').load({ plugins = { 'mason.nvim' } }) -local mr = require('mason-registry') +require("lazy").load({ plugins = { "mason.nvim" } }) +local mr = require("mason-registry") local pending = 0 local seen_any = false @@ -26,42 +26,46 @@ local seen_any = false -- Mason emits `package:install:handle` when an install starts (carrying the -- InstallHandle) and `package:install:success`/`:failed` on completion. There -- is no `:start` event. -mr:on('package:install:handle', function(handle) +mr:on("package:install:handle", function(handle) pending = pending + 1 seen_any = true - local name = handle.package and handle.package.name or '?' - log(string.format('install start: %s (pending=%d)', name, pending)) + local name = handle.package and handle.package.name or "?" + log(string.format("install start: %s (pending=%d)", name, pending)) end) -mr:on('package:install:success', function(pkg) +mr:on("package:install:success", function(pkg) pending = pending - 1 - log(string.format('install success: %s (pending=%d)', pkg.name, pending)) + log(string.format("install success: %s (pending=%d)", pkg.name, pending)) end) -mr:on('package:install:failed', function(pkg) +mr:on("package:install:failed", function(pkg) pending = pending - 1 - log(string.format('install failed: %s (pending=%d)', pkg.name, pending)) + log(string.format("install failed: %s (pending=%d)", pkg.name, pending)) end) -log('loading mason-lspconfig and mason-nvim-dap (triggers ensure_installed)') -require('lazy').load({ plugins = { 'mason-lspconfig.nvim', 'mason-nvim-dap.nvim' } }) +log("loading mason-lspconfig and mason-nvim-dap (triggers ensure_installed)") +require("lazy").load({ plugins = { "mason-lspconfig.nvim", "mason-nvim-dap.nvim" } }) -- Wait up to 30s for the first install:handle event. ensure_installed runs -- inside mason-registry.refresh() callbacks, which are async. If nothing -- needs installing (everything already present and registry cache fresh), -- no event fires and we proceed to exit. -log('waiting up to 30s for an install:handle event') -vim.wait(30000, function() return seen_any end, 200) +log("waiting up to 30s for an install:handle event") +vim.wait(30000, function() + return seen_any +end, 200) if not seen_any then - log('no installs triggered; assuming nothing to do') + log("no installs triggered; assuming nothing to do") else - log(string.format('draining mason install queue (%d pending, 10m cap)', pending)) - local ok = vim.wait(600000, function() return pending <= 0 end, 500) + log(string.format("draining mason install queue (%d pending, 10m cap)", pending)) + local ok = vim.wait(600000, function() + return pending <= 0 + end, 500) if not ok then - log(string.format('timeout: %d installs still pending; exiting anyway', pending)) + log(string.format("timeout: %d installs still pending; exiting anyway", pending)) else - log('all mason installs complete') + log("all mason installs complete") end end -log('exiting') -vim.cmd('qa!') +log("exiting") +vim.cmd("qa!")