Repository navigation
fix(filters): stop the task filter matching hyphenated commands - #4776
Open
sarankumar1325 wants to merge 1 commit into
Open
sarankumar1325 wants to merge 1 commit into
sarankumar1325 wants to merge 1 commit into
Conversation
`^task\b` also matched `task-start`, `task-runner` and other `task-*` programs, because `\b` sits between `k` and `-`. The hook then rewrote them to `rtk task-...` and the go-task filter truncated their output. Require whitespace or end of string after the name, as ssh.toml and liquibase.toml already do. Fixes rtk-ai#4775
📊 Automated PR Analysis
SummaryFixes the task filter's match_command regex from Review Checklist
Linked issues: #4775 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
Author
|
signed it :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/filters/task.toml:match_commandgoes from^task\bto^task(?:\s|$).\balso matches betweenkand-, sotask-start,task-runnerand./scripts/task-startwere rewritten by the hook and run through the go-task filter. This is the same shape ssh.toml and liquibase.toml use after fix(filters): tighten overly broad spring-boot/liquibase/ssh matching #3560.match_command = "^task\\b"matches hyphenated commands (task-start,task-runner), so the hook rewrites them #4775Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test(all pass, clippy clean)test_task_match_command_excludes_task_dash_commands(toml_filter.rs) andtest_rewrite_toml_task_ignores_hyphenated_commands(registry.rs). Both fail ondevelopand pass with the fix.rtk hook check "task-start foo"andrtk hook check "./scripts/task-start foo"now printNo rewrite for: ..., andrtk hook check "task build"still printsrtk task build.I wrote this change with help from an AI coding assistant, then reviewed it and ran the tests above.