Skip to content

Validate variable-name helper arguments - #28

Merged
codeforester merged 1 commit into
masterfrom
bug/14-20260618-variable-name-validation
Jun 18, 2026
Merged

codeforester merged 1 commit into
masterfrom
bug/14-20260618-variable-name-validation

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Summary

  • Centralize Bash variable-name validation in stdlib.
  • Validate stdlib assertion/result helpers before indirect expansion or printf -v.
  • Validate git_get_current_branch result variable names before assignment.
  • Add tests covering stdlib and git invalid-name diagnostics without leaking passed values.

Validation

  • RED: focused invalid-name BATS filters failed before the fix with raw/unclear behavior.
  • GREEN: focused invalid-name BATS filters pass.
  • bats lib/bash/std/tests/lib_std.bats
  • bats lib/bash/git/tests/lib_git.bats
  • shellcheck --severity=error lib/bash/std/lib_std.sh lib/bash/std/tests/lib_std.bats lib/bash/git/lib_git.sh lib/bash/git/tests/lib_git.bats
  • ./tests/validate.sh
  • git diff --check

Fixes #14

@codeforester
codeforester merged commit 33f0c66 into master Jun 18, 2026
2 checks passed
@codeforester
codeforester deleted the bug/14-20260618-variable-name-validation branch June 18, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate variable-name arguments consistently across stdlib helpers

1 participant