Skip to content

[Toolkit] Add lint kit command and CI lint workflow - #3655

Merged
Kocal merged 1 commit into
symfony:3.xfrom
Kocal:toolkit-add-lint-command
Jun 4, 2026
Merged

Kocal merged 1 commit into
symfony:3.xfrom
Kocal:toolkit-add-lint-command

Conversation

@Kocal

@Kocal Kocal commented Jun 4, 2026

Copy link
Copy Markdown
Member
Q A
Bug fix? no
New feature? yes
Deprecations? no
Documentation? no
Issues Fix #...
License MIT

Add a quality-control layer for Toolkit kits, so structural and dependency-coherence regressions are caught before they ship.

A new ux:toolkit:lint-kit <kit-path> command runs a pipeline of small checkers against a kit and reports issues per recipe.
The command is exposed as a standalone bin/ux-toolkit-kit-lint only, no DI wiring, since it has no value inside a user's app: it's a tool for kit maintainers, used locally or from CI.

Checks performed:

  • structural: missing recipe manifests, broken copy-files entries, unknown references in dependencies.recipe[] (errors);
  • coherence: Stimulus controllers used in Twig without a matching JS file, bare JS imports not declared in dependencies.npm / .importmap, and a curated mapping between Composer packages and the Twig symbols they provide.

A dedicated GitHub Actions workflow runs the linter on every kit undersrc/Toolkit/kits/* via a dynamically built matrix, triggered only whensrc/Toolkit/** changes.
Each kit gets its own job (fail-fast: false) so output stays readable and failures are isolated; adding a new kit needs no workflow change.

@Kocal Kocal self-assigned this Jun 4, 2026
@carsonbot carsonbot added Feature New Feature Toolkit Status: Needs Review Needs to be reviewed labels Jun 4, 2026
@Kocal
Kocal force-pushed the toolkit-add-lint-command branch 4 times, most recently from 5f1bc04 to 763472e Compare June 4, 2026 14:01
@seb-jean

seb-jean commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

This lint kit command is great, thank you.

Would it be difficult to add an option to fix errors?
Like the ones already available for PHP CS Fixer or Twig CS Fixer.

@Kocal

Kocal commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

(warnings found in the two jobs will be fixed in another PR)

Would it be difficult to add an option to fix errors?
Like the ones already available for PHP CS Fixer or Twig CS Fixer.

That's a good question, it's surely possible, maybe in a next iteration, if identified errors could be automatically fixed.

@Kocal
Kocal force-pushed the toolkit-add-lint-command branch from 654736b to e4a899a Compare June 4, 2026 20:05
@Kocal
Kocal merged commit 2a42eb0 into symfony:3.x Jun 4, 2026
31 of 33 checks passed
@Kocal
Kocal deleted the toolkit-add-lint-command branch June 4, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature Status: Needs Review Needs to be reviewed Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants