fix: baseline CPD duplications in migrated ANTLR generators#1467
Merged
joaodinissf merged 1 commit intoJul 13, 2026
Merged
Conversation
Enabling CPD (dsldevkit#1397, pmd.cpd.min 100000->100) and migrating the AnnotationAware ANTLR generators to Java (dsldevkit#1429) each passed CI in isolation, but their combination on master surfaced 4 intra-file duplications in the migrated generators that neither PR's build saw: CPD was still effectively disabled when dsldevkit#1429's checks ran, and dsldevkit#1397's baseline predated dsldevkit#1429's Java. The snapshot full scan caught it, leaving master red at cpd-check. These are faithfully migrated Xtend generators with parallel rule-emission structure, baselined with file-scoped CPD-OFF markers consistent with dsldevkit#1397's treatment of the analogous FormatJvmModelInferrer. Verified locally: pmd:cpd-check / checkstyle:check / pmd:check all green on com.avaloq.tools.ddk.xtext.generator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rubenporras
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Baselines 4 CPD duplications in three migrated ANTLR generators with file-scoped
CPD-OFFmarkers, restoring a greencpd-checkon master.AnnotationAwareAntlrContentAssistGrammarGenerator.javaAnnotationAwareAntlrGrammarGenerator.javaAnnotationAwareXtextAntlrGeneratorFragment2.javaWhy master went red
Two recently-merged PRs interacted in a way neither's CI could see on its own:
pmd.cpd.min100000 → 100) and baselined the duplications that existed on its branch.Merged together, master has CPD enabled and #1429's un-baselined migrated Java, so the
snapshotfull scan fails atcpd-checkwith 4 intra-file duplications. Rebase-merge does not re-run a PR's CI, so the combination first surfaced on master.Approach
These are faithful Xtend→Java migrations (the duplicated structure is inherited from the original Xtend's polymorphic dispatch — parallel rule-emission methods differing only in rule type, argument order, or a literal). They are baselined with file-scoped
CPD-OFF, consistent with the treatment of the analogousFormatJvmModelInferrerin #1397.Verification
Local, on
com.avaloq.tools.ddk.xtext.generator:pmd:cpd-check,checkstyle:check, andpmd:checkall green (CPD duplications 4 → 0).🤖 Generated with Claude Code