Problem/Motivation

Drupal Core is planning to #3284817: Adopt vincentlanglet/twig-cs-fixer for Twig coding standards

Let's do the same in our codebase.

Proposed resolution

Before tagging 1.0.0, run vendor/bin/twig-cs-fixer lint --fix /path/to/code a first time.

Do we also need to add something somewhere (README, Makefile...)?

Comments

pdureau created an issue. See original summary.

pdureau’s picture

Issue summary: View changes

Good opportunity to do those little Twig fixes too.

footer

Use `|default(foo)` filter instead of shorthand ternary `?:`

<a class="fr-footer__brand-link" href="{{ home_url|default('/') }}" title="{{ 'Homepage'|t }} - {{ operator_logo_alt ? operator_logo_alt : service_title }} - {{ logo_text }}">

translate

Unused variables: html_id

Function `random()` must be used in a `default()` filter!

  • pdureau committed 2da48f67 on 1.0.x
    Issue #3458956 by pdureau: Adopt vincentlanglet/twig-cs-fixer for Twig...
pdureau’s picture

Status: Active » Fixed

  • pdureau committed 903f4b82 on 1.0.x
    Issue #3458956 by pdureau: follow-up, 2 small fixes
    
pdureau’s picture

Status: Fixed » Closed (fixed)