Skip to content

Add dtset (alpha): xlsx/xlsm cell writer, replacing xlset - #3

Merged
eloualiche merged 7 commits into
mainfrom
feat/dtset-alpha
Oct 21, 2026
Merged

eloualiche merged 7 commits into
mainfrom
feat/dtset-alpha

Conversation

@eloualiche

Copy link
Copy Markdown
Member

Closes #2

Ports xlset from xl-cli-tools as dtset, behind an off-by-default alpha cargo feature. Default builds and the release binaries stay read-only: release.yml builds --bins with no features and ships only dtcat, dtfilter and dtdiff.

cargo install --path . --features alpha
dtset file.xlsx A1=42 B2:str=07401 --sheet Revenue
dtset file.xlsx --from updates.csv -o new.xlsx

What's new compared with xlset

  • Only .xlsx/.xlsm. Any other input or -o extension exits 2. -o must also keep the input's macro kind: xlsm→xlsx writes a file Excel won't open.
  • Atomic save. It writes a temp file in the same directory and renames it into place, so a failed write (for example a full disk) leaves the original byte-identical.
  • In-place edits:
    • keep the file's permission mode
    • refuse read-only (0444) files
    • edit the target of a symlink rather than replacing the link

Layout

  • src/edit/cell.rs: A1 parser and type inference, copied verbatim from xl-cli-tools with its unit tests.
  • src/edit/xlsx.rs: umya-spreadsheet writer, check_editable, check_output_kind.
  • src/bin/dtset.rs: the command-line front end. required-features = ["alpha"].
  • tests/dtset.rs: the 11 ported xlset tests plus 5 new ones. It is gated with #![cfg(feature = "alpha")].
  • CI gains alpha clippy and test steps so the gated code keeps compiling. Version bumped to 0.3.0.

Verification

  • cargo test --locked --features alpha: 274 passed.
  • cargo test --locked (no features): 214 passed, and umya is not in the dependency tree.
  • cargo clippy --all-targets -D warnings is clean with and without alpha, and cargo fmt --check is clean.

A fresh reviewer probed the binary directly: full disk, read-only directory, each non-xlsx format, formula and VBA survival, and = or , in values. Its findings are fixed in c8a4b81.

Known limitations (deferred)

  • The atomic rename breaks hard links and drops custom xattrs.
  • Errors show only the outer context message.
  • A flag placed after an assignment is rejected (exit 2) instead of being parsed.
  • --from treats a first row that isn't a valid cell reference as a header and skips it without a warning.

Companion PR: LouLouLibs/claude-skills#17

🤖 Generated with Claude Code

eloualiche and others added 7 commits October 21, 2026 17:29
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… xlsm/xlsx output (#2)

Found in final review: in-place edits reset the file mode to the umask default,
overwrote 0444 files, replaced symlinks with regular files, and allowed -o to
switch between .xlsm and .xlsx (producing a workbook Excel won't open).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@eloualiche
eloualiche merged commit a5ee404 into main Oct 21, 2026
1 check passed
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.

Add dtset (alpha): xlsx cell writer to replace xl-cli-tools

1 participant