Skip to content

refactor: replace > notation with blank-line grouping for commands#88

Merged
maxim-uvarov merged 22 commits into
nushell-prophet:mainfrom
maxim-uvarov-ai-assistant:refactor/blank-line-grouping
Dec 13, 2025
Merged

refactor: replace > notation with blank-line grouping for commands#88
maxim-uvarov merged 22 commits into
nushell-prophet:mainfrom
maxim-uvarov-ai-assistant:refactor/blank-line-grouping

Conversation

@maxim-uvarov-ai-assistant
Copy link
Copy Markdown

Summary

  • Removes the > notation for REPL-style commands in favor of blank-line grouping
  • Simplifies code by using $in instead of named parameters in closures
  • Uses cleaner negation syntax (not instead of !) in where clauses
  • Simplifies several functions: get-last-span, check-print-append, convert-short-options, execute-block-lines
  • Removes obsolete --whole_block flag
  • Updates all example markdown files for the new format

Test plan

  • Run nu toolkit.nu testing to verify all tests pass
  • Check that example files in z_examples/ execute correctly with numd run

claude and others added 22 commits December 11, 2025 22:15
Updates testing commands to produce properly formatted JSON:
- Add --quiet flag to testing-unit to suppress nutest terminal output
- Pass --quiet from main testing when JSON output is requested
- Use 'to json --raw' instead of 'to json' for valid JSON serialization

This fixes JSON output format issues when running tests in CI/automated environments.
Updated todo file to define clear implementation goals for removing the `>` notation from numd code block execution. The new approach will parse entire blocks, group commands by double newlines, and output results in `# =>` comment lines.
- Rewrite execute-block-lines to split by blank lines instead of > prefix
- Add split-by-blank-lines helper function
- Remove > stripping from remove-comments-plus
- Update clear-outputs to not preserve > lines
- Update capture start to use inline # => output format
- Add separate-block fence option for separate output blocks
- Change create-execution-code to use separate-block option
- Update code block parsing explanation (6-point list)
- Remove > notation from all code examples
- Update help output examples
- Remove reference to deleted types_of_data example
- Remove > notation from all example files
- Update to blank-line grouping format
- Regenerate # => output lines
- Update all _intermed.nu files with new execution format
- Update stripped markdown .nu files
This example had persistent formatting issues with the new
blank-line grouping format and is removed for now.
Update Example 2 to demonstrate the separate-block fence option
which outputs results in a separate code block instead of inline.
When a command produces no output (like variable assignments), the blank
line delimiter between command groups was being lost. This adds an
explicit `print ''` after each command group execution to ensure visual
separation is maintained in the output.
The --whole_block flag in create-execution-code was defined but never used in the function body. It became obsolete when the separate-block fence option was introduced. This commit removes the unused flag from:
- Function signature
- Example comment
- Function call in execute-block-lines

Also includes minor spacing beautification around closures.
…rt-options

- get-last-span: Remove redundant str trim -c "\n" before str trim
- check-print-append: Replace if/else returning booleans with single boolean expression
- convert-short-options: Extract result to explicit variable for clearer flow
Simplify regex negation from `where not ($it =~ ...)` to `where $it !~ ...` and improve formatting of boolean conditions in check-print-append for consistency with recent refactoring.
@maxim-uvarov maxim-uvarov merged commit 3b8a015 into nushell-prophet:main Dec 13, 2025
1 check failed
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.

3 participants