Feat mimetype exclude negation tokens - #107
Conversation
A token prefixed with `!` negates a match against the built-in MIME exclusion list, allowing individual entries to be re-enabled for compression. Within the same list, when multiple tokens match the same MIME type, the last one listed wins, positive or negative (gitignore-style precedence). The built-in list is only consulted as a fallback when the user-configured list produces no definitive match.
Cover the default built-in exclusion, overriding it with a negation token, and the last-matching-token-wins precedence when a positive and a negative token in the same list both match, in either order.
Explain the `!` token for re-enabling individual entries from the built-in exclusion list, and the last-match-wins precedence rule (gitignore-style: later tokens in the same list override earlier ones, whether positive or negative).
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe PR adds negated MIME-type patterns to zstd output compression exclusions. Matching supports wildcards and last-match precedence. Configured exclusions are evaluated before built-in exclusions. Tests and documentation cover the new behavior. ChangesMIME exclusion behavior
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to This localized MIME-type exclusion change includes documentation and tests, and no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant OutputHandler
participant MimeExclusionMatcher
participant ConfiguredExclusions
participant BuiltInExclusions
OutputHandler->>MimeExclusionMatcher: Check response MIME type
MimeExclusionMatcher->>ConfiguredExclusions: Evaluate configured tokens
ConfiguredExclusions-->>MimeExclusionMatcher: Return last matching result
alt No definitive configured match
MimeExclusionMatcher->>BuiltInExclusions: Check built-in exclusions
BuiltInExclusions-->>MimeExclusionMatcher: Return built-in result
end
MimeExclusionMatcher-->>OutputHandler: Return compression exclusion result
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Documentation
Tests