Skip to content

feat: enable using word expander without command substs - #877

Merged
reubeno merged 2 commits into
mainfrom
expander-options
Dec 27, 2025
Merged

reubeno merged 2 commits into
mainfrom
expander-options

Conversation

@reubeno

@reubeno reubeno commented Dec 27, 2025

Copy link
Copy Markdown
Owner

Some incremental improvements to the word expander:

  • Coalesces some of the _word and _str variants of internal expansion helpers. (Side bonus: removal of a .flatten() call, which did some string cloning).
  • Adds variants support word-expansion with customizable options.
  • Adds option to disable command substitution during expansion.

@github-actions

github-actions Bot commented Dec 27, 2025 •

Copy link
Copy Markdown

Test Results

    3 files     26 suites   10m 35s ⏱️
1 452 tests 1 452 ✅ 0 💤 0 ❌
4 336 runs  4 336 ✅ 0 💤 0 ❌

Results for commit baf98c3.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Dec 27, 2025 •

Copy link
Copy Markdown

Public API changes for crate: brush-parser

Added items

+impl core::convert::AsRef<str> for brush_parser::ast::Word
+pub fn brush_parser::ast::Word::as_ref(&self) -> &str

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 18.59 μs 18.03 μs -0.55 μs 🟢 -2.99%
eval_arithmetic 0.13 μs 0.13 μs -0.00 μs ⚪ Unchanged
expand_one_string 1.74 μs 1.68 μs -0.06 μs ⚪ Unchanged
for_loop 21.21 μs 21.28 μs 0.07 μs ⚪ Unchanged
function_call 2.65 μs 2.27 μs -0.38 μs 🟢 -14.32%
instantiate_shell 53.70 μs 54.58 μs 0.89 μs 🟠 +1.65%
instantiate_shell_with_init_scripts 23468.13 μs 23598.58 μs 130.45 μs ⚪ Unchanged
parse_bash_completion 2229.07 μs 2161.36 μs -67.70 μs 🟢 -3.04%
parse_sample_script 1.85 μs 1.86 μs 0.01 μs ⚪ Unchanged
run_echo_builtin_command 11.77 μs 11.84 μs 0.07 μs ⚪ Unchanged
tokenize_sample_script 3.51 μs 3.51 μs 0.00 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/arithmetic.rs 🟢 97.97% 🟢 98.01% 🟢 0.04%
brush-core/src/expansion.rs 🟢 95.22% 🟢 94.52% 🔴 -0.7%
brush-core/src/prompt.rs 🟢 92.41% 🟢 92.67% 🟢 0.26%
brush-parser/src/ast.rs 🔴 44.79% 🔴 44.99% 🟢 0.2%
Overall Coverage 🟢 74.11% 🟢 74.1% 🔴 -0.01%

Minimum allowed coverage is 70%, this run produced 74.1%

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1545 73.26
❗️ Error 19 0.90
❌ Fail 191 9.06
⏩ Skip 339 16.07
❎ Expected Fail 13 0.62
✔️ Unexpected Pass 2 0.09
📊 Total 2109 100.00

@reubeno
reubeno merged commit a184228 into main Dec 27, 2025
@reubeno
reubeno deleted the expander-options branch December 27, 2025 07:12
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.

1 participant