Skip to content

Commit

Permalink
Issue #4164: Changing twig and yaml linting namespace (#4165)
Browse files Browse the repository at this point in the history
* Issue #4164: Changing twing and yaml linting references from tests: to validate: namespace.

* Issue #4164: Changing tests:composer:validat invocation to validate:composer.

Co-authored-by: Dane Powell <git@danepowell.com>
  • Loading branch information
ba66e77 and danepowell committed Jun 9, 2020
1 parent 28cd469 commit 37f9849
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/extending-blt.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ To create your own fileset definition, complete the following steps:
#. Instantiate and return a ``Symfony\Component\Finder\Finder`` object. The
files found by the finder form the fileset.

To change the filesets used in commands such as ``tests:twig:lint:all``,
``tests:yaml:lint:all``, and ``tests:php:lint``, add the following
To change the filesets used in commands such as ``validate:twig:lint:all``,
``validate:yaml:lint:all``, and ``tests:php:lint``, add the following
configuration key to ``blt/blt.yml``:

.. code-block:: yaml
Expand Down Expand Up @@ -387,7 +387,7 @@ The following list includes some commonly customized Acquia BLT targets:
XML. For more information, see the official `PHPCS documentation
<https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file>`__.

- **tests:twig:lint:all**: To prevent validation failures on any Twig
- **validate:twig:lint:all**: To prevent validation failures on any Twig
filters or functions created in custom or contrib module
``twig.extension`` services, add filters and functions like the
following:
Expand Down
6 changes: 3 additions & 3 deletions src/Robo/Commands/Internal/GitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public function preCommitHook($changed_files) {
$collection->addCode(
function () use ($changed_files) {
return $this->invokeCommands([
'tests:twig:lint:files' => ['file_list' => $changed_files],
'tests:yaml:lint:files' => ['file_list' => $changed_files],
'validate:twig:lint:files' => ['file_list' => $changed_files],
'validate:yaml:lint:files' => ['file_list' => $changed_files],
]);
}
);
Expand All @@ -74,7 +74,7 @@ function () use ($changed_files) {
|| in_array('composer.lock', $changed_files_list)) {
$collection->addCode(
function () {
return $this->invokeCommand('tests:composer:validate');
return $this->invokeCommand('validate:composer');
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Commands/Validate/TwigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Twig\Loader\FilesystemLoader;

/**
* Defines commands in the "tests:twig:lint:all*" namespace.
* Defines commands in the "validate:twig:lint:all*" namespace.
*/
class TwigCommand extends BltTasks {

Expand Down
2 changes: 1 addition & 1 deletion src/Robo/Commands/Validate/YamlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Acquia\Blt\Robo\BltTasks;

/**
* Defines commands in the "tests:yaml:lint:all*" namespace.
* Defines commands in the "validate:yaml:lint:all*" namespace.
*/
class YamlCommand extends BltTasks {

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/src/SetupGitHooksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public function testGitPreCommitHook() {
$process->run();
$output = $process->getOutput();
$this->assertStringContainsString('tests:phpcs:sniff:staged', $output);
$this->assertStringContainsString('tests:yaml:lint:files', $output);
$this->assertStringContainsString('tests:twig:lint:files', $output);
$this->assertStringContainsString('validate:yaml:lint:files', $output);
$this->assertStringContainsString('validate:twig:lint:files', $output);
}

/**
Expand Down

0 comments on commit 37f9849

Please sign in to comment.