Skip to content

fix(rules): warn when targets select different rules for a shared file - #4024

Open
Oscar-Williams wants to merge 2 commits into
dyoshikawa:mainfrom
Oscar-Williams:fix/warn-shared-rule-selection
Open

Oscar-Williams wants to merge 2 commits into
dyoshikawa:mainfrom
Oscar-Williams:fix/warn-shared-rule-selection

Conversation

@Oscar-Williams

@Oscar-Williams Oscar-Williams commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Reproduced the missing warning on the base commit. On Ubuntu, verified normal generation, generate --check, and reversed --targets order through the CLI.
  • Ran 586 unit and integration tests on Ubuntu, including equivalent selections and conflicts that overwrite folded content.

@Oscar-Williams
Oscar-Williams marked this pull request as ready for review November 29, 2026 11:29

@dyoshikawa dyoshikawa left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
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