Skip to content

feat: named filter parameters and enhanced truncate#2

Merged
RoboNET merged 8 commits intomainfrom
feat/filter-named-params
Feb 26, 2026
Merged

feat: named filter parameters and enhanced truncate#2
RoboNET merged 8 commits intomainfrom
feat/filter-named-params

Conversation

@RoboNET
Copy link
Copy Markdown
Owner

@RoboNET RoboNET commented Feb 26, 2026

Summary

  • Named filter parameters: Extend filter syntax with key:value named params and boolean flags ({{value | truncate:30 suffix:'…' fromEnd}})
  • FilterArguments class: New FilterArguments abstraction replacing single TemplateValue? argument — provides Positional, GetNamed(), HasFlag()
  • Enhanced TruncateFilter: Configurable suffix (default "..."), fromEnd flag for reverse truncation, non-string input conversion (Number/Bool → string, Null → empty)
  • Breaking change: ITemplateFilter.Apply signature updated, all 8 built-in filters migrated

Test Plan

  • 8 FilterArguments unit tests
  • 10 parser tests for named params/flags
  • 2 evaluator integration tests
  • 12 enhanced TruncateFilter tests
  • 10 E2E pipeline tests (parser → evaluator → filter)
  • All existing filter tests pass (regression)
  • 5217 total tests pass on net8.0 + net10.0

@RoboNET RoboNET merged commit 109e5fa into main Feb 26, 2026
6 checks passed
@RoboNET RoboNET deleted the feat/filter-named-params branch February 26, 2026 10:59
RoboNET added a commit that referenced this pull request Mar 11, 2026
* feat(filters): add FilterArguments class and update ITemplateFilter signature

* refactor(filters): migrate all filters to FilterArguments signature

* feat(filters): add named parameter and flag parsing to filter syntax

* feat(filters): wire named parameters through evaluator to FilterArguments

* feat(filters): enhance truncate with suffix, fromEnd, and type conversion

* test: add end-to-end integration tests for named filter parameters

* docs: update wiki with named filter parameters and enhanced truncate

* fix(filters): add null guards, immutable empty dict, reduce allocations

- Add ArgumentNullException.ThrowIfNull(name) to GetNamed() and HasFlag()
- Replace mutable Dictionary in FilterArguments.Empty with ReadOnlyDictionary
- Reuse shared EmptyNamedDictionary in EvaluateFilter for positional-only case
- Remove unrelated context7.json from feature branch
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