diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-16 01:18:35 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-16 01:18:35 -0500 |
| commit | 531f0f19f298e28b42dfb216f6008a1cbc6164d3 (patch) | |
| tree | 050af9cc602ccbdccd4affb442657639eb1fd136 /tests/test-prog-python-setup.el | |
| parent | b5793851bfdc9e539b45f9d6830d093208cf0a86 (diff) | |
| download | dotemacs-531f0f19f298e28b42dfb216f6008a1cbc6164d3.tar.gz dotemacs-531f0f19f298e28b42dfb216f6008a1cbc6164d3.zip | |
feat(gptel-tools): wire update_text_file as a local tool with tests
I rewrote `update_text_file.el` in pure Elisp. The previous version
shelled out to sed for everything, had a stray quote terminator at EOF
(line 149) that broke loading, produced literal backslash-n where
actual newlines were expected, and prompted via `y-or-n-p` redundantly
with gptel's own `:confirm t` flag.
The five operations -- replace, append, prepend, insert-at-line,
delete-lines -- split into pure string transforms that test without
touching the disk. The file-level wrapper validates the path, enforces
a 10MB size limit, takes a timestamped backup, and writes atomically.
No backup is created when the operation is a no-op. Patterns are
literal substrings (not regex) so the model can't trip over
metacharacter quoting.
`tests/test-update-text-file.el` covers Normal / Boundary / Error per
operation plus the file-level wrapper. 48 tests green. Added
`update_text_file` to `cj/gptel-local-tool-features` so gptel exposes
the tool after restart.
Diffstat (limited to 'tests/test-prog-python-setup.el')
0 files changed, 0 insertions, 0 deletions
