Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Fixes #1543: Twig Lint is not maintained and fails valid twig code. #2151

Merged
merged 4 commits into from
Oct 18, 2017

Conversation

wu-edward
Copy link

Fixes #1543.

Changes proposed:

  • Remove asm89/twig-lint and use Symfony twig linter
  • Run twig lint command procedurally instead of in parallel, otherwise error messages are suppressed.
  • Account for Twig functions and filters added by Drupal, so that linter does not flag as invalid.
  • Provide config for users to add custom Twig filters and functions that can be specified in project.yml
  • Reorder precommit lint commands so that PHPUnit tests do not fail on Travis.

$this->invokeCommands([
// Passing a file list to be PHPCS will cause all specified files to
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to add this comment back :)

Copy link
Author

Choose a reason for hiding this comment

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

I refactored and removed all the changes to this class.

src/Robo/Blt.php Outdated
*
* @param \Acquia\Blt\Robo\Application $application
*/
protected function addSymfonyCommands(Application $application) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I do wish we could move this out of the Blt.php file. It feels like it doesn't belong here.

Copy link
Author

Choose a reason for hiding this comment

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

I agree, so I refactored and put everything in the TwigCommand class. I think it's cleaner now.

@grasmash grasmash added the Enhancement A feature or feature request label Oct 18, 2017
@grasmash grasmash merged commit 96dba3a into acquia:9.1.x Oct 18, 2017
@grasmash grasmash changed the title Issue 1543 Fixes #1543: Twig Lint is not maintained and fails valid twig code. Oct 18, 2017
@wu-edward wu-edward deleted the issue-1543 branch September 10, 2018 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants