feat(discover): add jq and yq rewrite rules; add yq TOML filter#1911
Open
tylern91 wants to merge 1 commit into
Open
feat(discover): add jq and yq rewrite rules; add yq TOML filter#1911tylern91 wants to merge 1 commit into
tylern91 wants to merge 1 commit into
Conversation
- Add RtkRule for `jq` routing unfiltered `jq` commands through the existing jq.toml filter (max_lines=40, truncate_lines_at=120). The filter already existed but had no hook rewrite rule, so bare `jq` invocations were never compressed. - Add RtkRule for `yq` and create src/filters/yq.toml with matching filter (max_lines=40, truncate_lines_at=120, strip blank lines). `yq` is the YAML counterpart to `jq` and follows the same compression pattern. - Update toml_filter.rs: filter count 59→60, add jq and yq to expected array, update concat assertion to 61. Closes rtk-ai#1364 (jq rewrite rule missing)
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
jq: The
jq.tomlfilter (max_lines=40, truncate_lines_at=120) has existed but had no rewrite rule indiscover/rules.rs. Barejqcommands were never routed through the filter by the hook. This PR adds the missingRtkRuleso the hook auto-rewritesjq→rtk jq.yq:
yqis the YAML equivalent ofjq— same compression pattern. Createssrc/filters/yq.toml(max_lines=40, truncate_lines_at=120, strips blank lines) and adds the correspondingRtkRule.Changes
src/discover/rules.rsRtkRuleentries (System category)src/filters/yq.tomlsrc/core/toml_filter.rsTest plan
cargo fmt --all— cleancargo clippy --all-targets -- -D warnings— zero warningscargo test --all— 1870 passed, 6 ignoredtest_builtin_filter_countpasses with count=60test_builtin_all_expected_filters_present— jq and yq verified presentCloses
Closes #1364 (jq rewrite rule missing from discover)
Closes #1910 (yq filter + rewrite rule)