php bin/console lint:twig

Lint a template and outputs encountered errors

Usage

lint:twig [--format FORMAT] [--show-deprecations] [--] [<filename>...]

Arguments

filename   A file, a directory or "-" for reading from STDIN 

Options

      --format              The output format 
      --show-deprecations   Show deprecations as errors 

Help

The lint:twig command lints a template and outputs to STDOUT
the first encountered syntax error.

You can validate the syntax of contents passed from STDIN:

  cat filename | php bin/console lint:twig -

Or the syntax of a file:

  php bin/console lint:twig filename

Or of a whole directory:

  php bin/console lint:twig dirname
  php bin/console lint:twig dirname --format=json

Or all template files in a bundle:

  php bin/console lint:twig @AcmeDemoBundle