An [override.<id>] table narrows where an inherited rule reads without restating its regexp or message - #204
Conversation
|
Warning Review limit reachedNext included review available in 12 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
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 |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (92.47%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #204 +/- ##
==========================================
- Coverage 93.63% 93.61% -0.02%
==========================================
Files 44 44
Lines 17057 17283 +226
==========================================
+ Hits 15971 16180 +209
- Misses 1086 1103 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…out restating its regexp or message (#204) A policy file may write `[override.<id>]` carrying `files.include`, `files.exclude` and `files.glob`. The loader keeps the inherited rule whole -- check, message and provenance -- and replaces only the `files` keys the table names, so a field it does not name keeps the set's value and a tightening the set ships later reaches the narrowed rule on the next pin bump. The one spelling before this was an own `[rule.<id>]`, which replaces the inherited rule whole and so restates the set's regexp and message byte for byte, with nothing to report when the copy stops being current. The table is read from the raw TOML rather than through a serde struct, so every refusal names the section and lists the three keys it may carry: an override carrying any other key, an override of an id nothing inherited defines or that `inherit.disabled_rules` drops, and an override beside an own `[rule.<id>]` of the same id are each refused at load. An `[override]` in a bundled set or an `inherit.paths` file is refused too, since such a file inherits nothing. The shadow report is untouched: a same-id rule that changes the check is still a full rule and still gets the note. This repository's own `no-stale-anchored-fact`, a same-id copy whose message had already drifted a sentence from the set's, becomes an override of the set's rule carrying the four excluded paths. The released shim on PATH cannot load a policy with the table until the next release, which is the same window adding a set opens. Closes #194
A policy file may write
[override.<id>]carryingfiles.include,files.excludeandfiles.glob. The loader keeps the inherited rulewhole -- check, message and provenance -- and replaces only the
fileskeys the table names, so a field it does not name keeps the set's value
and a tightening the set ships later reaches the narrowed rule on the
next pin bump. The one spelling before this was an own
[rule.<id>],which replaces the inherited rule whole and so restates the set's
regexp and message byte for byte, with nothing to report when the copy
stops being current.
The table is read from the raw TOML rather than through a serde struct,
so every refusal names the section and lists the three keys it may
carry: an override carrying any other key, an override of an id nothing
inherited defines or that
inherit.disabled_rulesdrops, and anoverride beside an own
[rule.<id>]of the same id are each refused atload. An
[override]in a bundled set or aninherit.pathsfile isrefused too, since such a file inherits nothing. The shadow report is
untouched: a same-id rule that changes the check is still a full rule
and still gets the note.
This repository's own
no-stale-anchored-fact, a same-id copy whosemessage had already drifted a sentence from the set's, becomes an
override of the set's rule carrying the four excluded paths. The
released shim on PATH cannot load a policy with the table until the
next release, which is the same window adding a set opens.
Closes #194