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..409c4bf6010 --- /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, with a test that pins the `declare -x` and `typeset -x` forms. 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 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' ---