Skip to content

fix: replace raw echo with output helpers in check#706

Merged
dnyw4l3n13 merged 7 commits into
mainfrom
fix/619-replace-raw-echo-in-check
Jun 25, 2026
Merged

fix: replace raw echo with output helpers in check#706
dnyw4l3n13 merged 7 commits into
mainfrom
fix/619-replace-raw-echo-in-check

Conversation

@github-actions

@github-actions github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaced script-local die, testing, hint, and fail functions in check with the canonical die, info, and success helpers from shell-scripts.instructions.md
  • All call sites updated: testing()info(), hint()info(), fail()die(), bare echo "Testing:" and echo "* $FILE"info()
  • excluded() function's echo "1"/echo "0" internal return values preserved unchanged
  • Shebang remains #!/bin/bash (script uses =~ and $BASH_REMATCH)

Closes #619

Test plan

  • bash -n check — syntax clean
  • shellcheck check — lint clean
  • All pre-commit hooks pass (verified in commit)

@github-actions github-actions Bot added the auto-pr Pull request created automatically label Jun 24, 2026
@dnyw4l3n13 dnyw4l3n13 added AI-Work Work for an AI Agent Urgent Urgent Priority labels Jun 24, 2026
@dnyw4l3n13 dnyw4l3n13 force-pushed the fix/619-replace-raw-echo-in-check branch from 69c777e to 48513bc Compare June 24, 2026 18:34
@credfeto

credfeto commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Super-linter summary

Language Validation result
BASH Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@dnyw4l3n13 dnyw4l3n13 force-pushed the fix/619-replace-raw-echo-in-check branch from 48513bc to c107189 Compare June 24, 2026 19:17
Comment thread check
Comment thread check Outdated
Comment thread check
@dnyw4l3n13 dnyw4l3n13 marked this pull request as draft June 24, 2026 19:29
Comment thread check
Comment thread check Outdated
@dnyw4l3n13 dnyw4l3n13 marked this pull request as ready for review June 24, 2026 19:45
@dnyw4l3n13 dnyw4l3n13 enabled auto-merge June 24, 2026 19:45
@dnyw4l3n13

Copy link
Copy Markdown
Collaborator

AI Review Complete

All review rounds and security review passed. Auto-merge enabled.

Changes made during review

Code Review (3 rounds):

  • Added success "All checks passed" at end of script — success() was defined but never called
  • Prefixed sh-portability advisory messages with Hint: to distinguish from progress steps
  • Replaced unquoted $FILES string with mapfile -t FILES array to prevent word-splitting on paths containing spaces
  • Added [ "${#FILES[@]}" -gt 0 ] || die "..." guard to prevent false-positive success when no scripts are found
  • Added ${FILE} to all six die messages inside the per-file loop — die() writes to stderr while info "* $FILE" writes to stdout; CI systems capturing them separately would lose filename context
  • Added two additional CHANGELOG entries for the mapfile and empty-files guard correctness fixes

Security Review:
No vulnerabilities found.

Replaced the script-local die/testing/hint/fail functions with the
canonical die, info, and success helpers from shell-scripts.instructions.md.
All call sites updated; excluded() echo "1"/"0" return values preserved.

Prompt: Replace raw echo with output helpers in `check` (issue #619)

Closes #619
success() was defined but never called, leaving the script silent on
successful completion — indistinguishable from mid-run termination.

Prompt: fix each code-review finding in its own commit
…ogress steps

The old hint() function emitted '  ? CHECK: ...' making advisories
visually distinct from progress steps. Replacing with info() collapses
them to the same format. Prefixing with 'Hint:' restores distinction.

Prompt: fix each code-review finding in its own commit
for FILE in \$FILES word-splits on \$IFS, breaking paths containing
spaces. mapfile -t + \"${FILES[@]}\" handles any filename safely.

Prompt: fix each code-review finding in its own commit
success "All checks passed" fired even with no files found, giving a
false-positive result when BASEDIR was wrong or no scripts existed.

Prompt: fix each code-review finding in its own commit
die() now writes to stderr while info "* \$FILE" writes to stdout.
CI systems capturing them separately lose filename context. Adding
\${FILE} to every die message in the loop restores that context.

Prompt: fix each code-review finding in its own commit
The original entry only mentioned output helper replacement; two
correctness fixes (mapfile word-splitting safety and empty-files guard)
were omitted and warranted their own entries.

Prompt: fix each code-review finding in its own commit
@dnyw4l3n13 dnyw4l3n13 force-pushed the fix/619-replace-raw-echo-in-check branch from 2b9127a to abfe83b Compare June 25, 2026 19:33
@dnyw4l3n13 dnyw4l3n13 merged commit 834192e into main Jun 25, 2026
25 checks passed
@dnyw4l3n13 dnyw4l3n13 deleted the fix/619-replace-raw-echo-in-check branch June 25, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Work Work for an AI Agent auto-pr Pull request created automatically Urgent Urgent Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace raw echo with output helpers in check

2 participants