Skip to content

Evaluate Twig-CS-Fixer + twigcs + twig-linter integration for template quality #269

@coisa

Description

@coisa

Problem

Template and view-layer quality is currently not covered by a dedicated Twig-focused toolchain.

Twig-CS-Fixer, twigcs, and twig-linter each cover different areas (format, lint, and language-specific validation) that can prevent template regressions.

Proposal

Group these tools into one evaluation issue for a shared Twig template quality command profile.

Adoption plan:

  • Evaluate all three tools and define minimum viable command set.
  • Add one or more optional commands/subcommands (twig:fix, twig:lint, or generic analysis profile).
  • Keep execution opt-in and non-blocking by default.
  • Add docs showing how to configure template paths and severity thresholds.

Goals

  • Improve template-level quality gates for repositories with Twig usage.
  • Avoid duplicated or contradictory formatting/linting behavior.
  • Keep template checks reproducible in CI.

Expected Benefits

  • Reduced merge risk in Twig-heavy repositories.
  • Clearer conventions around template coding standards and validation.

Why Not (if skipped)

  • Additional install/dependency footprint.
  • Configuration drift across repositories with different coding styles.

Non-goals

  • Replacing front-end tooling for framework-specific template preprocessors.
  • Enforcing hard-failure in all repos immediately.

Acceptance Criteria

  • A clear single strategy for all three tools is documented and accepted.
  • At least one command path is implemented as an evaluation spike.
  • Rules/paths are configurable and local overrides take precedence.

Architectural / Isolation Criteria

  • MUST: Template checks are isolated into a dedicated tool adapter layer.
  • MUST: Report generation is deterministic and idempotent.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions