Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
Some Twig templates in core violate the following Twig coding standard:
Put one (and only one) space after the start of a delimiter (
{{
,{%
, and{#
) and before the end of a delimiter (}}
,%}
, and#}
)
Proposed resolution
Fix them.
Remaining tasks
Patch
Followup issue (child of #2571965: [meta] Fix PHP coding standards in core) to automate Twig CS checking
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Comment | File | Size | Author |
---|---|---|---|
#11 | taxonomy-term-twig-cs-2644718-11.patch | 1.54 KB | gvso |
#7 | fix-coding-standards-on-taxonomy-term-twig-file-2644718-7.patch | 978 bytes | leolandotan |
taxonomy-term-twig-cs.patch | 468 bytes | kmonty | |
Comments
Comment #2
kmontyComment #3
mmatsoo CreditAttribution: mmatsoo at Chromatic commentedWorked for me! RTBC.
Comment #4
star-szrI think this is one of the very few cases in which it's safe to change Stable as well, so let's do so :)
Comment #5
star-szrComment #6
star-szrComment #7
leolandotan CreditAttribution: leolandotan as a volunteer and at Promet Source commentedHi, here I have also updated the taxonomy-term.html.twig file for the Stable theme.
I also got an updated 8.1.x branch.
Thanks!
Comment #8
leolandotan CreditAttribution: leolandotan as a volunteer and at Promet Source commentedComment #9
gvsoWorked for me! RTBC +1
Comment #10
star-szrThanks! So I did find a similar case in Bartik, we can at least fix all similar cases like this so that this issue has a bit more reasonable scope per https://www.drupal.org/core/scope#coding-standards. Expanding the title and summary accordingly. @kmonty it might be too big for trivial patch of the month but I think it's better this way :)
You can grep with your editor/IDE or via shell (with globbing):
We don't currently have any automated way to check Twig coding standards so we could probably use a sub-issue of #2571965: [meta] Fix PHP coding standards in core to at least discuss this, tagging for follow-up for that.
Comment #11
gvsoFixed the missing space in Bartik
Comment #12
johnmcc CreditAttribution: johnmcc as a volunteer commentedLooks good to me and applies cleanly to 8.1.x.
Comment #13
mmatsoo CreditAttribution: mmatsoo at Chromatic commentedRTBC +1. (On both 8.1.0-dev and 8.0.4)
Comment #14
mmatsoo CreditAttribution: mmatsoo at Chromatic commentedComment #16
star-szrThanks! We need that follow-up filed, can someone please do so and add it as a related issue here?
Committed c3707e1 and pushed to 8.1.x. Thanks!