Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "digitalpolygon/polymer-pantheon-drupal",
"type": "polymer-plugin",
"description": "Helpful scripts and tools for integrating Drupal with Pantheon.",
"authors":[
{
Expand All @@ -14,11 +15,6 @@
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"DigitalPolygon\\PolymerPantheon\\Drupal\\": "./src/"
}
},
"require": {
Comment thread
lpeabody marked this conversation as resolved.
"digitalpolygon/polymer-drupal": "0.x-dev",
"pantheon-systems/drupal-integrations": "* !=11.0.0"
Expand All @@ -35,17 +31,23 @@
"digitalpolygon/polymer": true,
"digitalpolygon/drupal-upgrade-plugin": true,
"phpstan/extension-installer": true,
"phpro/grumphp-shim": true
"phpro/grumphp-shim": true,
"composer/installers": true
}
},
"scripts": {
"lint": "find src test/src -name '*.php' -print0 | xargs -0 -n1 -P4 -- php -l",
"cs": "phpcs",
"cs": "phpcs --standard=phpcs-non-drupal.xml.dist --report=full -s",
"sa": "phpstan analyse -v -c phpstan.neon",
"validations": [
"@lint",
"@cs",
"@sa"
]
},
"autoload-dev": {
"psr-4": {
"DigitalPolygon\\Polymer\\polymer_drupal\\": "vendor/digitalpolygon/polymer-drupal/src/"
}
}
}
19 changes: 18 additions & 1 deletion grumphp.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
grumphp:
tasks: { }
hooks_dir: grumphp/hooks
tasks:
phpcs:
standard: PSR12
warning_severity: 0
whitelist_patterns:
- src
# phpcs_drupal:
# standard:
# - Drupal
# - DrupalPractice
# warning_severity: 0
# whitelist_patterns:
# - settings
# metadata:
# task: phpcs
phpstan: null
phplint: null
27 changes: 27 additions & 0 deletions grumphp/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/sh

#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#

GIT_USER=$(git config user.name)
GIT_EMAIL=$(git config user.email)
COMMIT_MSG_FILE=$1

# Fetch the GIT diff and format it as command input:
DIFF=$(git -c diff.mnemonicprefix=false -c diff.noprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat)

# Grumphp env vars
$(ENV)
export GRUMPHP_GIT_WORKING_DIR="$(git rev-parse --show-toplevel)"

DDEV_PREFIX="ddev exec --"
COMMAND_PREFIX=""

if [ -z "${IS_DDEV_PROJECT}" ] && [ -d .ddev ] && command -v ddev >/dev/null 2>&1; then
COMMAND_PREFIX="${DDEV_PREFIX}"
fi

# Run GrumPHP
(cd "${HOOK_EXEC_PATH}" && printf "%s\n" "${DIFF}" | $COMMAND_PREFIX $(EXEC_GRUMPHP_COMMAND) $(HOOK_COMMAND) "--git-user='$GIT_USER'" "--git-email='$GIT_EMAIL'" "$COMMIT_MSG_FILE")
23 changes: 23 additions & 0 deletions grumphp/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

#
# Run the hook command.
# Note: this will be replaced by the real command during copy.
#

# Fetch the GIT diff and format it as command input:
DIFF=$(git -c diff.mnemonicprefix=false -c diff.noprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat)

# Grumphp env vars
$(ENV)
export GRUMPHP_GIT_WORKING_DIR="$(git rev-parse --show-toplevel)"

DDEV_PREFIX="ddev exec --"
COMMAND_PREFIX=""

if [ -z "${IS_DDEV_PROJECT}" ] && [ -d .ddev ] && command -v ddev >/dev/null 2>&1; then
COMMAND_PREFIX="${DDEV_PREFIX}"
fi

# Run GrumPHP
(cd "${HOOK_EXEC_PATH}" && printf "%s\n" "${DIFF}" | $COMMAND_PREFIX $(EXEC_GRUMPHP_COMMAND) $(HOOK_COMMAND) '--skip-success-output')
9 changes: 9 additions & 0 deletions phpcs-drupal.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="polymer-drupal-settings">
<description>Default PHP CodeSniffer configuration for the Drupal Integration for Polymer WebOps Tooling project.</description>
<file>settings</file>
<rule ref="Drupal" />
<rule ref="DrupalPractice" />
<arg value="n" />
<arg value="s" />
</ruleset>
8 changes: 8 additions & 0 deletions phpcs-non-drupal.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="polymer-drupal-src">
<description>Default PHP CodeSniffer configuration for the Drupal Integration for Polymer WebOps Tooling project.</description>
<file>src</file>
<rule ref="PSR12" />
<arg value="n" />
<arg value="s" />
</ruleset>
14 changes: 0 additions & 14 deletions phpcs.xml.dist

This file was deleted.

1 change: 1 addition & 0 deletions polymer_pantheon_drupal.poly_info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
name: Polymer Pantheon Drupal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Exception;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Exception;

class TerminusPluginNotInstalledException extends \RuntimeException
{
Expand Down
4 changes: 2 additions & 2 deletions src/Polymer/ExtensionInfo.php → src/ExtensionInfo.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal;

use DigitalPolygon\Polymer\Robo\Extension\PolymerExtensionBase;
use DigitalPolygon\Polymer\Core\Robo\Extension\PolymerExtensionBase;

class ExtensionInfo extends PolymerExtensionBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Commands;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Commands;

use Consolidation\AnnotatedCommand\Attributes\Command;
use Consolidation\AnnotatedCommand\Attributes\HookSelector;
use DigitalPolygon\Polymer\Robo\Tasks\TaskBase;
use DigitalPolygon\Polymer\Core\Robo\Tasks\TaskBase;
use Robo\Exception\AbortTasksException;
use Robo\Symfony\ConsoleIO;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Commands;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Commands;

use Consolidation\AnnotatedCommand\Attributes\Command;
use Consolidation\AnnotatedCommand\Attributes\Hook;
use Consolidation\AnnotatedCommand\Attributes\HookSelector;
use Consolidation\AnnotatedCommand\Attributes\Option;
use Consolidation\AnnotatedCommand\CommandData;
use Consolidation\AnnotatedCommand\Hooks\HookManager;
use DigitalPolygon\Polymer\Robo\Commands\Template\TemplateCommand;
use DigitalPolygon\Polymer\Robo\Tasks\TaskBase;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\DrushSiteYaml;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\PantheonYaml;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\QuicksilverYaml;
use DigitalPolygon\Polymer\Core\Robo\Commands\Template\TemplateCommand;
use DigitalPolygon\Polymer\Core\Robo\Tasks\TaskBase;
use DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\DrushSiteYaml;
use DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\PantheonYaml;
use DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\QuicksilverYaml;
use Robo\Contract\VerbosityThresholdInterface;
use Robo\Symfony\ConsoleIO;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Hooks;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Hooks;

use Consolidation\AnnotatedCommand\AnnotatedCommand;
use Consolidation\AnnotatedCommand\AnnotationData;
use Consolidation\AnnotatedCommand\Attributes\Hook;
use Consolidation\AnnotatedCommand\CommandData;
use Consolidation\AnnotatedCommand\Hooks\HookManager;
use DigitalPolygon\Polymer\Robo\Commands\Artifact\DeployCommand;
use DigitalPolygon\Polymer\Robo\Exceptions\BadConfigurationValueException;
use DigitalPolygon\Polymer\Robo\Tasks\TaskBase;
use DigitalPolygon\Polymer\Core\Robo\Commands\Artifact\DeployCommand;
use DigitalPolygon\Polymer\Core\Robo\Exceptions\BadConfigurationValueException;
use DigitalPolygon\Polymer\Core\Robo\Tasks\TaskBase;

class PantheonArtifactHook extends TaskBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template;

use DigitalPolygon\Polymer\Robo\Template\Template;
use DigitalPolygon\Polymer\Robo\Template\Token;
use DigitalPolygon\Polymer\Core\Robo\Template\Template;
use DigitalPolygon\Polymer\Core\Robo\Template\Token;

class DrushSiteYaml extends Template
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\GitHubWorkflows;

use DigitalPolygon\Polymer\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Robo\Template\Token;
use DigitalPolygon\Polymer\Core\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Core\Robo\Template\Token;

final class PantheonPrMultidevCreate extends GitHubWorkflowTemplateBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\GitHubWorkflows;

use DigitalPolygon\Polymer\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Robo\Template\Token;
use DigitalPolygon\Polymer\Core\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Core\Robo\Template\Token;

final class PantheonPrMultidevDelete extends GitHubWorkflowTemplateBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\GitHubWorkflows;

use DigitalPolygon\Polymer\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Robo\Template\Token;
use DigitalPolygon\Polymer\Core\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Core\Robo\Template\Token;

final class PantheonPush extends GitHubWorkflowTemplateBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template\GitHubWorkflows;

use DigitalPolygon\Polymer\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Robo\Template\Token;
use DigitalPolygon\Polymer\Core\Robo\Template\GitHub\GitHubWorkflowTemplateBase;
use DigitalPolygon\Polymer\Core\Robo\Template\Token;

final class PantheonPushDev extends GitHubWorkflowTemplateBase
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template;

use DigitalPolygon\Polymer\Robo\Template\Template;
use DigitalPolygon\Polymer\Robo\Template\Token;
use DigitalPolygon\Polymer\Core\Robo\Template\Template;
use DigitalPolygon\Polymer\Core\Robo\Template\Token;

class PantheonYaml extends Template
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Plugin\Template;

use DigitalPolygon\Polymer\Robo\Template\Template;
use DigitalPolygon\Polymer\Core\Robo\Template\Template;

class QuicksilverYaml extends Template
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal;

use DigitalPolygon\Polymer\Robo\Template\TemplateInterface;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\DrushSiteYaml;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows\PantheonPrMultidevCreate;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows\PantheonPrMultidevDelete;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows\PantheonPush;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\GitHubWorkflows\PantheonPushDev;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\PantheonYaml;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Plugin\Template\QuicksilverYaml;
use DigitalPolygon\PolymerPantheon\Drupal\Polymer\Services\EventSubscriber\DrupalEventsSubscriber;
use DigitalPolygon\Polymer\polymer_pantheon_drupal\Services\EventSubscriber\DrupalEventsSubscriber;
use League\Container\ServiceProvider\AbstractServiceProvider;
use League\Container\ServiceProvider\BootableServiceProviderInterface;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php

namespace DigitalPolygon\PolymerPantheon\Drupal\Polymer\Services\EventSubscriber;
namespace DigitalPolygon\Polymer\polymer_pantheon_drupal\Services\EventSubscriber;

use Consolidation\Config\ConfigInterface;
use DigitalPolygon\Polymer\Robo\Config\ConfigAwareTrait;
use DigitalPolygon\PolymerDrupal\Polymer\Services\Event\SiteSettingsFiles;
use DigitalPolygon\Polymer\Core\Robo\Config\ConfigAwareTrait;
use DigitalPolygon\Polymer\polymer_drupal\Services\Event\SiteSettingsFiles;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Robo\Contract\ConfigAwareInterface;
Expand Down
Loading