From fe36dc42ade5a08f2485290ca6d9916900dc5032 Mon Sep 17 00:00:00 2001 From: "melodic-automation-lanes[bot]" <337595936+melodic-automation-lanes[bot]@users.noreply.github.com> Date: Tue, 3 Nov 2026 06:31:52 +0000 Subject: [PATCH 1/2] refactor(plugin-quality): fold repeated resets and patterns in the audit collectors --- ...y-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md | 7 +++++++ .../skills/audit/scripts/collect-categories.sh | 9 +++------ .../skills/audit/scripts/collect-standards.sh | 7 ++----- 3 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 .changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md diff --git a/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md b/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md new file mode 100644 index 00000000000..1a909ec31f2 --- /dev/null +++ b/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md @@ -0,0 +1,7 @@ +--- +bump: patch +--- + +### Changed + +- Tidied the audit collectors: one per-heading state reset in collect-categories.sh, a guard clause and a single declaration alternation in collect-standards.sh. diff --git a/plugins/plugin-quality/skills/audit/scripts/collect-categories.sh b/plugins/plugin-quality/skills/audit/scripts/collect-categories.sh index b9a532ff638..df889fdd1c9 100755 --- a/plugins/plugin-quality/skills/audit/scripts/collect-categories.sh +++ b/plugins/plugin-quality/skills/audit/scripts/collect-categories.sh @@ -222,12 +222,12 @@ BEGIN { line = trim($0) if (line ~ /^## /) { close_section() + marker = "" + items = 0 + finding_open = 0 name = substr(line, 4) if (name == "Blindspots" || name == "Doc-worthy gotchas" || name == "Unverified claims") { section = "" - marker = "" - items = 0 - finding_open = 0 next } if (name != "Errors" && name != "Improvements" && name != "Quality of life" && @@ -240,9 +240,6 @@ BEGIN { } else { section = name } - marker = "" - items = 0 - finding_open = 0 next } if (section == "" || line == "") next diff --git a/plugins/plugin-quality/skills/audit/scripts/collect-standards.sh b/plugins/plugin-quality/skills/audit/scripts/collect-standards.sh index 57dbebcd944..0ccb7438c79 100755 --- a/plugins/plugin-quality/skills/audit/scripts/collect-standards.sh +++ b/plugins/plugin-quality/skills/audit/scripts/collect-standards.sh @@ -114,10 +114,7 @@ findings=0 cite() { local file="$1" needle="$2" line - if [[ ! -f "$file" ]]; then - printf '' - return - fi + [[ -f "$file" ]] || return 0 line="$(grep -n -F "$needle" "$file" | head -n 1 | cut -d: -f1)" printf '%s' "$line" } @@ -275,7 +272,7 @@ if [[ ! -f "$win_file" ]]; then elif [[ -z "$win_cite" ]]; then emit_probe windows-path-emit basis-missing "$win_rel" - "citation sentence absent" else - export_line="$(grep -n -E 'export[[:space:]]+(MSYS_NO_PATHCONV|MSYS2_ARG_CONV_EXCL)|declare[[:space:]]+-x[[:space:]]+(MSYS_NO_PATHCONV|MSYS2_ARG_CONV_EXCL)|typeset[[:space:]]+-x[[:space:]]+(MSYS_NO_PATHCONV|MSYS2_ARG_CONV_EXCL)' "$COMPONENT" | head -n 1 | cut -d: -f1 || true)" + export_line="$(grep -n -E '(export|declare[[:space:]]+-x|typeset[[:space:]]+-x)[[:space:]]+(MSYS_NO_PATHCONV|MSYS2_ARG_CONV_EXCL)' "$COMPONENT" | head -n 1 | cut -d: -f1 || true)" if [[ -n "$export_line" ]]; then emit_probe windows-path-emit finding "$win_rel:$win_cite" "$COMPONENT:$export_line" "exported path-conversion suppressor" else From fed01f9e1df69d866987a2af22ea9c40639ae921 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Tue, 3 Nov 2026 05:22:57 -0500 Subject: [PATCH 2/2] test(plugin-quality): pin each declaration form the folded suppressor regex matches The tidy in #12763 folded the windows-path-emit probe's three declaration forms into one alternation. Add cases that flag `declare -x` and `typeset -x` at their line and leave a per-command `MSYS_NO_PATHCONV=1 cmd` ungraded, so dropping a form fails the suite. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Vcupom3BKF6QuC5U3sRJPj --- ...oc-plugins-plugin-quality-2026-11-03-8ec3e79c.md | 2 +- .../skills/audit/scripts/collect-standards.test.sh | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md b/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md index 1a909ec31f2..409c4bf6010 100644 --- a/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md +++ b/.changes/plugin-quality/chore-tidy-adhoc-plugins-plugin-quality-2026-11-03-8ec3e79c.md @@ -4,4 +4,4 @@ bump: patch ### Changed -- Tidied the audit collectors: one per-heading state reset in collect-categories.sh, a guard clause and a single declaration alternation in collect-standards.sh. +- Tidied the audit collectors: one per-heading state reset in collect-categories.sh, a guard clause and a single declaration alternation in collect-standards.sh, with a test that pins the `declare -x` and `typeset -x` forms. diff --git a/plugins/plugin-quality/skills/audit/scripts/collect-standards.test.sh b/plugins/plugin-quality/skills/audit/scripts/collect-standards.test.sh index d7922caaa96..af2c5d6b39a 100755 --- a/plugins/plugin-quality/skills/audit/scripts/collect-standards.test.sh +++ b/plugins/plugin-quality/skills/audit/scripts/collect-standards.test.sh @@ -88,6 +88,19 @@ has "seam-phrasing status=candidate" "the seam lead is reported" has "status=not-applicable" "hook-budget stays not-applicable" has "SKILL.md:" "a component path is cited" +mkdir -p "$ROOT/skills/declared" "$ROOT/skills/typeset" "$ROOT/skills/local-only" +printf '%s\n' 'declare -x MSYS2_ARG_CONV_EXCL="*"' >"$ROOT/skills/declared/run.sh" +printf '%s\n' 'typeset -x MSYS_NO_PATHCONV=1' >"$ROOT/skills/typeset/run.sh" +printf '%s\n' 'MSYS_NO_PATHCONV=1 tool.exe /c' >"$ROOT/skills/local-only/run.sh" +for form in declared typeset; do + run 1 "a $form path-conversion suppressor is an export" \ + --component "$ROOT/skills/$form/run.sh" --root "$ROOT" + has "run.sh:1 note=exported path-conversion suppressor" "the $form form is flagged at its line" +done +run 0 "a per-command suppressor is not an export" \ + --component "$ROOT/skills/local-only/run.sh" --root "$ROOT" +has "windows-path-emit status=not-graded" "the per-command form is not graded" + mkdir -p "$ROOT/skills/clean" cat >"$ROOT/skills/clean/SKILL.md" <<'EOF' ---