Skip to content

[Site] Apply twig-cs-fixer #1935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2024
Merged

[Site] Apply twig-cs-fixer #1935

merged 1 commit into from
Jun 26, 2024

Conversation

smnandre
Copy link
Member

No description provided.

@carsonbot carsonbot added Site ux.symfony.com Status: Needs Review Needs to be reviewed labels Jun 22, 2024
@VincentLanglet
Copy link

If you want to have less failing build when bumping the Twig-cs-fixer library version, you may prefer to use the Symfony standard (which use only rules explicitly described in the Twig/Symfony doc) and manually add the rules you want to use.

The Twig-CS-Fixer standard (similar to the PHP-cs-fixer standard) is kinda opinionated and may add new rules in minor version (I'll try to always respect semantic versioning and never use new rule in a patch version). But since you're having a composer.lock (https://github.com/symfony/ux/blob/2.x/ux.symfony.com/composer.lock) you can also keep the current strategy of using the Twig-CS-Fixer.

Be aware that if someday you don't like a rule you will be able to remove it with

->removeRule(TheRuleIDontLike::class);

in your config. Have fun with this tool, and I'm always looking for feedback/bug report/feature request :)

@smnandre
Copy link
Member Author

->removeRule(TheRuleIDontLike::class);

I used it yesterday because i was not sure about the HashQuote 😅

But you're right, the safest option would probably be to use the Symfony standard as a base !

@kbond
Copy link
Member

kbond commented Jun 26, 2024

Thanks Simon.

@kbond kbond merged commit 5467d57 into symfony:2.x Jun 26, 2024
3 of 4 checks passed
javiereguiluz added a commit that referenced this pull request Jul 30, 2024
This PR was merged into the 2.x branch.

Discussion
----------

[Site] Custom TwigCsFixer config

(will be rebased after #1947)

Answering you here `@VincentLanglet` (regarding #1935 (comment))

Would this be the "good/safe" way to go... ?

...or should we create a Standard (and just customize the demo/memory thing here) ?

Commits
-------

8a66e74 [Site] Custom TwigCsFixer config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Site ux.symfony.com Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants