Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct issues with ! extglobs and compgen -X #317

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Jan 10, 2025

Fixes multiple issues with extglob pattern matching support, particularly with !(...) patterns. Additional changes for use of patterns as filter expressions in completion (notably, fixes to inversion).

Updates to pattern parsing:

  • brush-parser/src/pattern.rs: Refactored the extended_glob_body rule to simplify the parsing of extended glob patterns and adjusted how negative lookaheads are handled in the regex generation. [1] [2] [3]

Addition of test cases:

Other changes:

@reubeno reubeno requested a review from Copilot January 10, 2025 22:51

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • brush-core/src/completion.rs: Evaluated as low risk
  • brush-shell/tests/completion_tests.rs: Evaluated as low risk
Copy link

github-actions bot commented Jan 10, 2025

Test Results

    2 files      9 suites   1m 17s ⏱️
  585 tests   585 ✅ 0 💤 0 ❌
1 156 runs  1 156 ✅ 0 💤 0 ❌

Results for commit e573b85.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 10, 2025

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 16.76 μs 16.40 μs -0.36 μs 🟢 -2.16%
eval_arithmetic 0.18 μs 0.19 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.71 μs 1.61 μs -0.09 μs ⚪ Unchanged
for_loop 33.02 μs 32.32 μs -0.70 μs 🟢 -2.12%
function_call 3.35 μs 3.27 μs -0.08 μs ⚪ Unchanged
instantiate_shell 47.53 μs 48.41 μs 0.89 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 22405.01 μs 22252.38 μs -152.63 μs ⚪ Unchanged
parse_bash_completion 1686.54 μs 1681.00 μs -5.54 μs ⚪ Unchanged
parse_sample_script 2.22 μs 2.17 μs -0.05 μs 🟢 -2.34%
run_echo_builtin_command 16.20 μs 16.03 μs -0.16 μs ⚪ Unchanged
run_one_external_command 1982.57 μs 2048.34 μs 65.77 μs 🟠 +3.32%

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/builtins/complete.rs 🟠 75% 🟢 75.58% 🟢 0.58%
brush-core/src/completion.rs 🟠 63.1% 🟠 63.18% 🟢 0.08%
brush-core/src/jobs.rs 🔴 43.1% 🔴 37.07% 🔴 -6.03%
brush-core/src/patterns.rs 🟢 97.95% 🟢 98.46% 🟢 0.51%
brush-core/src/shell.rs 🟢 82.27% 🟢 82.4% 🟢 0.13%
Overall Coverage 🟢 76.83% 🟢 76.96% 🟢 0.13%

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

@reubeno reubeno merged commit 94e6a83 into main Jan 10, 2025
17 checks passed
@reubeno reubeno deleted the extglob-fixes branch January 10, 2025 23:05
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