You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We like to use cpd for code duplication checks for Twig templates. These files use .twig as extensions.
They are not recognized as files containing html.
Is is possible to accept them as html files or is there any other workaround?
I'm afraid, there is currently no workaround. For PMD, we introduced for such cases the option --force-language. This is also available for CPD (via AbstractConfiguration#setForceLanguageVersion), but it is not wired through as a CLI-parameter. So, it is only programmatically available. But adding the CLI parameter for CPD should not be a big deal.
Activity
adangel commentedon Dec 21, 2023
I'm afraid, there is currently no workaround. For PMD, we introduced for such cases the option
--force-language. This is also available for CPD (via AbstractConfiguration#setForceLanguageVersion), but it is not wired through as a CLI-parameter. So, it is only programmatically available. But adding the CLI parameter for CPD should not be a big deal.Related issues: #1540, #3417, #2133, #461
cappadaan commentedon Dec 21, 2023
--force language and/or --rulesets as CLI-parameter for CPD would be very helpful!