Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .github/workflows/toolkit-kits-code-quality.yaml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/toolkit-kits-lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Toolkit Kits Linting

on:
push:
paths:
- 'src/Toolkit/**'
- '.github/workflows/toolkit-kits-lint.yaml'
pull_request:
paths:
- 'src/Toolkit/**'
- '.github/workflows/toolkit-kits-lint.yaml'

jobs:
get-matrix:
runs-on: ubuntu-latest
outputs:
kits: ${{ steps.set-kits.outputs.kits }}
steps:
- uses: actions/checkout@v4

- name: Set kits output
id: set-kits
run: |
KITS_JSON=$(find src/Toolkit/kits -mindepth 1 -maxdepth 1 -type d -printf '"%f",' | sed 's/,$//')
echo "kits=[${KITS_JSON}]" >> $GITHUB_OUTPUT

lint:
runs-on: ubuntu-latest
needs: get-matrix
strategy:
fail-fast: false
matrix:
kit: ${{ fromJson(needs.get-matrix.outputs.kits) }}

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1

- name: Install composer packages
uses: ramsey/composer-install@v3
with:
working-directory: src/Toolkit

- name: Ensure Twig files are nicely formatted
run: php vendor/bin/twig-cs-fixer lint kits/${{ matrix.kit }}
working-directory: src/Toolkit
19 changes: 19 additions & 0 deletions src/Toolkit/.twig-cs-fixer.dist.php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-used the config from symfony/symfony#60761

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

$ruleset = new TwigCsFixer\Ruleset\Ruleset();
$ruleset->addStandard(new TwigCsFixer\Standard\TwigCsFixer());

$config = new TwigCsFixer\Config\Config();
$config->setCacheFile('.twig-cs-fixer.cache');
$config->setRuleset($ruleset);

return $config;
2 changes: 1 addition & 1 deletion src/Toolkit/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"symfony/http-client": "6.4|^7.0|^8.0",
"symfony/stopwatch": "^6.4|^7.0|^8.0",
"symfony/phpunit-bridge": "^7.2|^8.0",
"vincentlanglet/twig-cs-fixer": "^3.5",
"vincentlanglet/twig-cs-fixer": "^3.9",
"spatie/phpunit-snapshot-assertions": "^4.2.17",
"phpunit/phpunit": "^9.6.22",
"symfony/ux-icons": "^2.18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
) -%}

<div
class="{{ style.apply({variant}, attributes.render('class'))|tailwind_merge }}"
class="{{ style.apply({variant: variant}, attributes.render('class'))|tailwind_merge }}"
role="alert"
{{ attributes }}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
) -%}
<div
class="{{ style.apply({variant, outline}, attributes.render('class'))|tailwind_merge }}"
class="{{ style.apply({variant: variant, outline: outline}, attributes.render('class'))|tailwind_merge }}"
{{ attributes }}
>
{%- block content %}{% endblock -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
) -%}

<{{ as }}
class="{{ style.apply({variant, outline, size}, attributes.render('class'))|tailwind_merge }}"
class="{{ style.apply({variant: variant, outline: outline, size: size}, attributes.render('class'))|tailwind_merge }}"
{{ attributes }}
>
{%- block content %}{% endblock -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
) -%}
<div
class="{{ style.apply({orientation, decorative}, attributes.render('class'))|tailwind_merge }}"
class="{{ style.apply({orientation: orientation, decorative: decorative}, attributes.render('class'))|tailwind_merge }}"
{{ attributes.defaults({
role: decorative ? 'none' : 'separator',
'aria-orientation': decorative ? false : orientation,
Expand Down
Loading