This repository was archived by the owner on Mar 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 394
Issue 1543 twig lint replacement #2062
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1070202
Remove twig-lint and add Symfony twig-bridge.
a6d108f
Add default config for custom Twig filters and functions for linter t…
0a89653
Replace twig-lint with Symfony LintCommand.
eb10977
Update Blt.php
grasmash 12c8775
Update ArrayInput.php
grasmash fa0ba62
Update documentation for adding custom Twig function and filters.
42257a2
Use regex to extract Twig functions and filters from Drupal TwigExten…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Acquia\Blt\Robo\Commands\Input; | ||
|
||
use Symfony\Component\Console\Input\ArrayInput as ArrayInputBase; | ||
|
||
/** | ||
* ArrayInput class. | ||
*/ | ||
class ArrayInput extends ArrayInputBase { | ||
|
||
/** | ||
* Escapes a token through escapeshellarg if it contains unsafe chars. | ||
* | ||
* @param array|string $token | ||
* | ||
* @return string | ||
*/ | ||
public function escapeToken($token) { | ||
// Account for ArrayInput arguments possibly being arrays to prevent | ||
// warning when casting to string. | ||
// @todo Remove when Drupal allows upgrade to Symfony Console 3.3.9+. | ||
// @see https://github.com/symfony/symfony/issues/24087. | ||
if (is_array($token)) { | ||
foreach ($token as $key => $value) { | ||
$token[$key] = preg_match('{^[\w-]+$}', $value) ? $value : escapeshellarg($value); | ||
} | ||
return implode(' ', $token); | ||
} | ||
return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't you removing the
validate:twig:files
command above? Doesn't seem like it makes sense to call it here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
validate:twig:files
gets added insrc/Robo/Blt.php
line 157.