Skip to content

fix(complete): complete current and parent directories.#887

Merged
reubeno merged 2 commits into
reubeno:mainfrom
MasahikoSawada:complete_current_parent_dirs
Mar 15, 2026
Merged

fix(complete): complete current and parent directories.#887
reubeno merged 2 commits into
reubeno:mainfrom
MasahikoSawada:complete_current_parent_dirs

Conversation

@MasahikoSawada
Copy link
Copy Markdown
Contributor

This PR is to complete '.' (current directory) and '..' (parent directory) correctly.

@MasahikoSawada MasahikoSawada force-pushed the complete_current_parent_dirs branch from f767818 to d99396f Compare December 31, 2025 06:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 31, 2025

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 17.29 μs 17.21 μs -0.08 μs ⚪ Unchanged
eval_arithmetic 0.15 μs 0.15 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.62 μs 1.60 μs -0.01 μs ⚪ Unchanged
for_loop 26.19 μs 26.13 μs -0.06 μs ⚪ Unchanged
full_peg_complex 57.31 μs 58.31 μs 1.00 μs 🟠 +1.75%
full_peg_for_loop 6.15 μs 6.22 μs 0.07 μs 🟠 +1.14%
full_peg_nested_expansions 16.67 μs 16.95 μs 0.28 μs 🟠 +1.66%
full_peg_pipeline 4.24 μs 4.37 μs 0.13 μs 🟠 +3.14%
full_peg_simple 1.84 μs 1.88 μs 0.04 μs 🟠 +2.17%
function_call 3.01 μs 2.76 μs -0.24 μs 🟢 -8.12%
instantiate_shell 55.15 μs 54.97 μs -0.18 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 27134.98 μs 28424.37 μs 1289.39 μs 🟠 +4.75%
parse_peg_bash_completion 2054.05 μs 2101.01 μs 46.96 μs 🟠 +2.29%
parse_peg_complex 19.77 μs 20.27 μs 0.50 μs 🟠 +2.53%
parse_peg_for_loop 1.96 μs 2.04 μs 0.08 μs 🟠 +4.09%
parse_peg_pipeline 2.06 μs 2.19 μs 0.13 μs 🟠 +6.30%
parse_peg_simple 1.11 μs 1.12 μs 0.01 μs ⚪ Unchanged
run_echo_builtin_command 18.24 μs 18.14 μs -0.10 μs ⚪ Unchanged
tokenize_sample_script 3.47 μs 3.47 μs 0.00 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/completion.rs 🟠 53.74% 🟠 53.81% 🟢 0.07%
brush-core/src/results.rs 🟢 83.33% 🟢 80.16% 🔴 -3.17%
Overall Coverage 🟢 74.28% 🟢 74.25% 🔴 -0.03%

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

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1583 75.06
❗️ Error 18 0.85
❌ Fail 154 7.30
⏩ Skip 339 16.07
❎ Expected Fail 13 0.62
✔️ Unexpected Pass 2 0.09
📊 Total 2109 100.00

@reubeno
Copy link
Copy Markdown
Owner

reubeno commented Dec 31, 2025

Thanks for posting this, @MasahikoSawada! The change looks reasonable and even seems to increase the pass rate on bash-completion tests 😄

The test failure looks like it's coming from the new assertions you've added to completion_tests.rs. I assume you'll look into that?

@reubeno reubeno added area: completion Issues or PRs related to completion area: compat Related to compatibility with standard shells labels Dec 31, 2025
@reubeno
Copy link
Copy Markdown
Owner

reubeno commented Feb 18, 2026

Hi @MasahikoSawada -- are you still interested in finishing this up?

We appreciate the contribution and it would be great to get this merged. (I'm assuming it primarily needs a rebase and a look at the failing unit tests?)

@reubeno
Copy link
Copy Markdown
Owner

reubeno commented Mar 15, 2026

Hi @MasahikoSawada -- I see that you've provided access for maintainers to push to your PR branch. I've picked this back up and have a targeted adjustment to get the tests passing (and rebase against latest changes).

Thanks for getting the ball rolling 😄

@reubeno reubeno force-pushed the complete_current_parent_dirs branch from d99396f to 1f6b910 Compare March 15, 2026 21:53
@reubeno reubeno force-pushed the complete_current_parent_dirs branch from 1f6b910 to 9231775 Compare March 15, 2026 22:31
@reubeno reubeno merged commit ae48967 into reubeno:main Mar 15, 2026
43 checks passed
takeshiD pushed a commit to takeshiD/brush that referenced this pull request Mar 30, 2026
Corrects completion of `.` and `..`.

---------
Co-authored-by: reuben olinsky <reubeno@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compat Related to compatibility with standard shells area: completion Issues or PRs related to completion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants