Symfony Lint Command
The Symfony Lint Command allows you to check the syntax of your YAML, Container, Twig, Translation, and Schema files.
Linting YAML Files
To lint a YAML file, run the following command:
symfony console lint:yaml ./config
Linting Container Files
To lint a Container file, run the following command:
symfony console lint:container
Linting Twig Files
To lint a Twig file, run the following command:
symfony console lint:twig ./templates
Linting Schema Files
To lint a Schema file, run the following command:
symfony console doctrine:schema:validate --skip-sync -vvv --no-interaction
Linting Translation Files
To lint a XLIFF file, run the following command:
symfony console lint:xliff translations
To lint a YAML file, run the following command:
symfony console lint:yaml translations
To export the linting results to JSON, run the following command:
symfony console lint:xliff translations --format=json
symfony console lint:yaml translations --format=json
To run the linting command on a GitHub Action, run the following command:
php bin/console lint:yaml translations/ --format=github
php bin/console lint:xliff translations/ --format=github