Skip to content

[cpd] Recognize twig as html file #4780

Open

Description

@cappadaan

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?

Activity

  1. added
    an:enhancement
    on Dec 19, 2023
  2. added
    in:cpd
    in:cli
    on Dec 21, 2023
  3. adangel commented on Dec 21, 2023

    @adangel
    Member

    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

  4. cappadaan commented on Dec 21, 2023

    @cappadaan
    Author

    --force language and/or --rulesets as CLI-parameter for CPD would be very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementin:cliin:cpd

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions