Skip to content

Feat/run once#113

Merged
maxim-uvarov merged 6 commits intomainfrom
feat/run-once
Mar 30, 2026
Merged

Feat/run once#113
maxim-uvarov merged 6 commits intomainfrom
feat/run-once

Conversation

@maxim-uvarov
Copy link
Copy Markdown
Member

Summary

  • Add run-once fence option that executes a code block once, then rewrites the fence to no-run so subsequent numd run calls skip it. Closes add option run-once #71
  • Works with combined options (e.g., nu run-once, try → nu no-run, try)
  • Drop short-form 1 — it required a fragile \b1\b regex on the raw fence string, and run-once is inherently a one-time annotation where a short form adds no
    convenience
  • Docs: fix stale section title, heading structure, add extract-block-index and merge-markdown pipeline steps to commands explanations
  • Fix @example list literal syntax in extract-fence-options

Test plan

  • Unit tests for decorate-original-code-blocks verifying run-once → no-run rewriting (alone, combined with other options, plain blocks unchanged)
  • Unit tests for classify-block-action and extract-fence-options with run-once combined options
  • Integration test file z_examples/6_edge_cases/run_once.md — both run-once and run-once, no-output
  • Verified second run produces no output (both blocks become no-run)
  • All existing unit tests pass

claude and others added 6 commits March 29, 2026 22:01
The `1` short form required a fragile `\b1\b` regex on the raw fence
string in decorate-original-code-blocks, separate from the existing
extract-fence-options/convert-short-options pipeline. Since run-once
is inherently a one-time annotation (it rewrites itself to no-run),
a short form adds no real convenience.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Unit tests for decorate-original-code-blocks verifying run-once → no-run
  rewriting, including combined options (run-once, try) and plain blocks
- Unit tests for classify-block-action and extract-fence-options with
  combined run-once options
- Integration test file (z_examples/6_edge_cases/run_once.md) exercising
  run-once alone and combined with no-output

The core rewriting logic (run-once → no-run in the output fence) had
zero direct test coverage — these tests close that gap.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@maxim-uvarov maxim-uvarov merged commit 9d8e5f2 into main Mar 30, 2026
1 of 2 checks passed
@maxim-uvarov maxim-uvarov deleted the feat/run-once branch March 30, 2026 01:03
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 option run-once

2 participants