Skip to content

Commit

Permalink
Merge pull request #3 from acquia/ACMS-3749
Browse files Browse the repository at this point in the history
ACMS-3749: Grumphp added.
  • Loading branch information
vishalkhode1 authored Apr 9, 2024
2 parents c202fc0 + d872018 commit 8a370bf
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 24 deletions.
39 changes: 21 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
{
"name": "acquia/drs-acsf",
"description": "Acquia recommended acsf drush commands.",
"keywords": [
"name": "acquia/drs-acsf",
"description": "Acquia recommended acsf drush commands.",
"license": "GPL-2.0-or-later",
"keywords": [
"acsf",
"drupal"
],
"license": "GPL-2.0-or-later",
"authors": [{
"name": "Acquia Engineering",
"homepage": "https://www.acquia.com",
"role": "Maintainer"
"authors": [
{
"name": "Acquia Engineering",
"homepage": "https://www.acquia.com",
"role": "Maintainer"
},
{
"name": "Chandan Singh",
"email": "[email protected]",
"role": "Maintainer"
"name": "Chandan Singh",
"email": "[email protected]",
"role": "Maintainer"
}
],
"require": {
"acquia/drupal-recommended-settings": "^1.0",
"drupal/acsf": "^2.47.0"
},
"require-dev": {
"acquia/coding-standards": "^1.0",
"ergebnis/composer-normalize": "^2.30.2",
"phpro/grumphp-shim": "^2.2"
},
"repositories": {
"drupal": {
"type": "composer",
"url": "https://packages.drupal.org/8"
}
},
"require": {
"drupal/acsf":"^2.47.0",
"acquia/drupal-recommended-settings": "^1.0"
},
"require-dev": {
"acquia/coding-standards": "^1.0"
},
"autoload": {
"psr-4": {
"Acquia\\DrsAcsf\\": "src/"
Expand Down
2 changes: 2 additions & 0 deletions factory-hooks/post-sites-php/includes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* @file
* ACSF post-sites-php hook.
*
* @phpcs:disable SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable.DisallowedSuperGlobalVariable
*
* @see https://docs.acquia.com/site-factory/tiers/paas/workflow/hooks
*/

Expand Down
24 changes: 24 additions & 0 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
parameters:
git_dir: .
grumphp:
ascii:
failed: grumphp-grumpy.txt
succeeded: grumphp-happy.txt
process_timeout: 60
tasks:
git_commit_message:
enforce_no_subject_trailing_period: false
matchers:
'Must begin with a JIRA issue number': '/^ACMS-[0-9]+: /'
max_body_width: 0
max_subject_width: 0
yamllint: ~
composer: ~
composer_normalize: ~
phpcs:
standard: ['phpcs.xml.dist']
ignore_patterns:
- .github
- vendor
triggered_by:
- php
24 changes: 24 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset -->
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">

<description>PHP CodeSniffer configuration for analyzing acquia/drupal-recommended-settings project.</description>

<!-- Use colors in output. -->
<arg name="colors"/>
<!-- Show progress. -->
<arg value="p"/>
<!-- Run in parallel. -->
<arg name="parallel" value="10"/>

<file>.</file>

<exclude-pattern>.idea/</exclude-pattern>
<exclude-pattern>var/</exclude-pattern>
<exclude-pattern>vendor/</exclude-pattern>

<rule ref="AcquiaPHP"/>

</ruleset>
11 changes: 5 additions & 6 deletions src/Drush/Commands/AcsfRecipesDrushCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

use Acquia\Drupal\RecommendedSettings\Drush\Commands\BaseDrushCommands;
use Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException;
use Consolidation\AnnotatedCommand\AnnotationData;
use Consolidation\AnnotatedCommand\Hooks\HookManager;
use Drush\Attributes as Cli;
use Robo\Contract\VerbosityThresholdInterface;
use Robo\ResultData;
use Symfony\Component\Console\Input\InputInterface;
use Drush\Attributes as Cli;

/**
* A DrsAcsfCommands drush command file.
Expand Down Expand Up @@ -42,7 +40,8 @@ public function drsAcsfInitialize(): int {
$this->drsAcsfHooksInitialize();
$this->drsAcsfComposerInitialize();
$this->drsAcsfDrushInitialize();
} catch (\Exception $e) {
}
catch (\Exception $e) {
$this->print($e->getMessage(), "error");
return ResultData::EXITCODE_ERROR;
}
Expand All @@ -52,7 +51,7 @@ public function drsAcsfInitialize(): int {
/**
* Refreshes the ACSF settings and hook files.
*
* @throws SettingsException|\Robo\Exception\TaskException
* @throws \Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException|\Robo\Exception\TaskException
*/
#[CLI\Command(name: "drs:acsf:init:drush", aliases: ["daid"])]
#[CLI\Help(description: "Refreshes the ACSF settings and hook files.")]
Expand Down Expand Up @@ -94,7 +93,7 @@ public function drsAcsfComposerInitialize(): void {
/**
* Creates "factory-hooks/" directory in project's repo root.
*
* @throws SettingsException
* @throws \Acquia\Drupal\RecommendedSettings\Exceptions\SettingsException
*/
#[CLI\Command(name: "drs:acsf:init:hooks", aliases: ["daih"])]
#[CLI\Help(description: "Creates \"factory-hooks/\" directory in project's repo root.")]
Expand Down

0 comments on commit 8a370bf

Please sign in to comment.