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] 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