Repository navigation
fix(rules): warn when targets select different rules for a shared file - #4024
Oscar-Williams wants to merge 2 commits into
Conversation
dyoshikawa
left a comment
There was a problem hiding this comment.
Thanks for this, and sorry for the overlap. Your PR was opened first, but #4029 has since landed on main and covers the same item from #4021. It warns when targets that share a root rule file write different contents and include narrows one of the selections, and it keeps the fold-overwrite warning (with its reorder advice) whenever the overwritten fold target actually folded rules, so each file gets one warning. Because of that, this branch now conflicts in fold-root-overwrite-watch.ts, generate.ts and e2e-rules.spec.ts, and as far as I can tell it would no longer add behaviour on top of main.
If you see a case your version catches and #4029 misses, I'd be glad to hear it. A failing test against current main would be the easiest way to show it, and we can take it from there. Otherwise I think this one can be closed as superseded.
Summary
Warn when two targets select different rules for the same output file. The warning identifies both targets and the path, and keeps the existing guidance when a target overwrites folded rules.
Refs #4021 (shared output paths).
Verification
generate --check, and reversed--targetsorder through the CLI.