Skip to content

fix: matching and hydration rules#632

Merged
5rahim merged 3 commits into5rahim:nextfrom
Zaicol:fix/matching-and-hydration-rules
Feb 24, 2026
Merged

fix: matching and hydration rules#632
5rahim merged 3 commits into5rahim:nextfrom
Zaicol:fix/matching-and-hydration-rules

Conversation

@Zaicol
Copy link
Copy Markdown
Contributor

@Zaicol Zaicol commented Feb 24, 2026

Summary

Small PR to fix oversights which prevent custom matching and hydration rules from working.

Problems

1. Hydrator

  • Problem - hydrator was checking the length of fh.Config.Matching.Rules and was skipping precompileRules if the length of it was 0
  • Solution - changed len(fh.Config.Matching.Rules) to len(fh.Config.Hydration.Rules)

2. Matcher

  • Problem - m.matchingRules was not initialized, causing panic: assignment to entry in nil map when adding matching rules
  • Solution - added make(map[string]*compiledMatchingRule) before assigning a rule

Modified files

  • internal\library\scanner\hydrator.go
  • internal\library\scanner\matcher.go
  • internal\library\scanner\matcher_test.go - added tests for rules at the end of a file

@5rahim 5rahim changed the base branch from main to next February 24, 2026 12:11
@5rahim 5rahim merged commit fbfd5c0 into 5rahim:next Feb 24, 2026
1 check passed
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.

2 participants