Skip to content

Tighten helper contracts#33

Merged
codeforester merged 1 commit into
masterfrom
enhancement/19-20260618-helper-contract-cleanup
Jun 18, 2026
Merged

Tighten helper contracts#33
codeforester merged 1 commit into
masterfrom
enhancement/19-20260618-helper-contract-cleanup

Conversation

@codeforester

Copy link
Copy Markdown
Owner

Summary

  • Make safe_mkdir option parsing and empty-argument behavior explicit.
  • Allow BASE_GIT_PULL_MAX_ATTEMPTS to configure pull retry attempts.
  • Refactor git_get_current_branch to use git -C and return empty-success for missing/non-Git directories.
  • Document the tightened stdlib and git helper contracts.

Validation

  • RED: focused safe_mkdir and git helper contract tests failed before the implementation.
  • GREEN: bats --filter "safe_mkdir (warns|rejects)" lib/bash/std/tests/lib_std.bats
  • GREEN: bats --filter "(missing directories|does not use pushd|configured max attempts)" lib/bash/git/tests/lib_git.bats
  • 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
  • git diff --check
  • ./tests/validate.sh

Fixes #19

@codeforester codeforester merged commit 583eb57 into master Jun 18, 2026
2 checks passed
@codeforester codeforester deleted the enhancement/19-20260618-helper-contract-cleanup branch June 18, 2026 19:41
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.

Tighten small helper contracts in stdlib and git libraries

1 participant