Skip to content

Expose file section inspection helpers#124

Merged
codeforester merged 1 commit into
mainfrom
feat/101-20260706-file-section-inspection
Jul 7, 2026
Merged

Expose file section inspection helpers#124
codeforester merged 1 commit into
mainfrom
feat/101-20260706-file-section-inspection

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Summary

  • Add public file_section_exists and file_section_needs_update helpers to lib/bash/file/lib_file.sh.
  • Reuse the same full-line marker validation posture as update_file_section, including asymmetric and misordered marker errors.
  • Document the inspection helpers and their return contracts for dry-run and backup decisions.

Fixes #101.

Validation

  • RED: bats --filter "file_section" lib/bash/file/tests/lib_file.bats failed before implementation because the helpers were missing.
  • PASS: bats --filter "file_section" lib/bash/file/tests/lib_file.bats
  • PASS: bats lib/bash/file/tests/lib_file.bats
  • PASS: bash -n lib/bash/file/lib_file.sh lib/bash/file/tests/lib_file.bats
  • PASS: shellcheck -S warning lib/bash/file/lib_file.sh lib/bash/file/tests/lib_file.bats
  • PASS: git diff --check
  • PASS: ./tests/validate.sh

@codeforester codeforester merged commit 424ef9f into main Jul 7, 2026
2 checks passed
@codeforester codeforester deleted the feat/101-20260706-file-section-inspection branch July 7, 2026 03:12
codeforester added a commit to basefoundry/base that referenced this pull request Jul 7, 2026
## Summary

- Replace `update_profile.sh`'s local marker-count and section-content
temp-file comparison with shared `base-bash-libs` file section helpers.
- Add an import capability check for `file_section_exists` and
`file_section_needs_update` so older helper checkouts fail clearly.
- Pin CI to `base-bash-libs` commit
`424ef9fe61bc8a462ba9980ea63b38dd202ec242`, which landed the companion
helper PR.

Companion helper PR: basefoundry/base-bash-libs#124.

Fixes #1492.

## Validation

- RED: `env
BASE_BASH_LIBS_DIR=/Users/rameshhp/work/base-bash-libs/lib/bash bats
--filter "shared file section helper"
cli/bash/commands/basectl/tests/update-profile.bats` failed before
implementation because the shared helper stubs were not called.
- PASS: `env
BASE_BASH_LIBS_DIR=/Users/rameshhp/work/base-bash-libs/lib/bash bats
--filter "shared file section helper"
cli/bash/commands/basectl/tests/update-profile.bats`
- PASS: `env
BASE_BASH_LIBS_DIR=/Users/rameshhp/work/base-bash-libs/lib/bash bats
cli/bash/commands/basectl/tests/update-profile.bats`
- PASS: `bash -n cli/bash/commands/basectl/subcommands/update_profile.sh
cli/bash/commands/basectl/tests/update-profile.bats`
- PASS: `shellcheck -S warning
cli/bash/commands/basectl/subcommands/update_profile.sh
cli/bash/commands/basectl/tests/update-profile.bats`
- PASS: `env PYTHONPATH=lib/python:cli/python
$HOME/.base.d/base/.venv/bin/python -m pytest
tests/test_github_workflows.py`
- PASS: `git diff --check`
- PASS: `env -u BASE_HOME
BASE_BASH_LIBS_DIR=/Users/rameshhp/work/base-bash-libs/lib/bash
BASE_CACHE_DIR=/private/tmp/base-pr-train-1492 ./bin/base-test`
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.

file: expose marked-section inspection for profile cleanup

1 participant