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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.2.0]
### Added
- Added coding standards for `drupal`.
- Added packages for `phpstan` for drupal based on [this documentation](https://www.drupal.org/docs/develop/development-tools/phpstan/getting-startedhttps://www.drupal.org/docs/develop/development-tools/phpstan/getting-started)
- `phpstan/phpstan`
- `phpstan/extension-installer`
- `mglaman/phpstan-drupal`
- `phpstan/phpstan-deprecation-rules`
- Added package for `phpcs` based on (this documentation)[https://www.drupal.org/docs/extending-drupal/contributed-modules/contributed-module-documentation/coder/installing-coder]
- `drupal/coder`

### Fixed
- Mapping for drupal was added to prevent error that file is missing in `templates/mapping/project/drupal`.

### Changed
- Allow `squizlabs/php_codesniffer` to be installed in a project with version `4.x` or higher, since the `drupal/coder` package requires this.

## [3.1.2]
### Fixed
- `Failed to locate the main schema resource at 'https://pmd.sourceforge.io/ruleset_xml_schema.xsd'` for php 8.3 and 8.4)
Expand Down Expand Up @@ -33,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added exclude for UnusedFormalParameter to allow unused parameters in a function
- Added exception for short variable name for $id
- PHPCS Excluded Magento2.Annotation.MethodAnnotationStructure.MethodAnnotation

### Fixed
- Updated property for LongVariable did not work.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The Youwe Testing Suites offers pre-configured standards for the following proje

| Testing Suite Project Type | Detected based on Composer Project Type |
|----------------------------|----------------------------------------------------------------------------|
| `drupal` | `drupal-bundle`, `drupal-project` |
| `drupal` | `drupal-module`, `drupal-project` |
| `magento2` | `magento-module`, `magento-project`, `magento2-module`, `magento2-project` |
| `pimcore` | `pimcore-bundle`, `pimcore-project` |
| `default` | Any other |
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"phpmd/phpmd": "^2.15 || 3.x-dev",
"phpro/grumphp-shim": "^2.15",
"phpstan/phpstan": "@stable",
"squizlabs/php_codesniffer": "^3.12.0",
"squizlabs/php_codesniffer": "^3.12.0 || ^4.0",
Comment thread
rutgerrademaker marked this conversation as resolved.
"youwe/composer-dependency-installer": "^2.0",
"youwe/composer-file-installer": "^2.0.0"
},
Expand Down
8 changes: 8 additions & 0 deletions config/drupal/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ parameters:
# securitychecker.allow_list:
# - CVE-2002-0121 # Add a jira ticket indicating when this vulnerability will be fixed (update/upgrade will be
# performed). Within that ticket explain this (new) vulnerability.

grumphp:
tasks:
phpcs:
ignore_patterns:
- /^build\//
- /^drush\//
- /^\.ddev\//
27 changes: 27 additions & 0 deletions src/Installer/PackagesInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,33 @@ class PackagesInstaller implements InstallerInterface
'updateDependencies' => true,
]
],
'drupal' => [
'drupal/coder' => [
'version' => '@stable',
'updateDependencies' => true,
'allowVersionOverride' => false,
],
'phpstan/phpstan' => [
'version' => '@stable',
'updateDependencies' => true,
'allowVersionOverride' => false,
],
'phpstan/extension-installer' => [
'version' => '@stable',
'updateDependencies' => true,
'allowVersionOverride' => false,
],
'mglaman/phpstan-drupal' => [
'version' => '@stable',
'updateDependencies' => true,
'allowVersionOverride' => false,
],
'phpstan/phpstan-deprecation-rules' => [
'version' => '@stable',
'updateDependencies' => true,
'allowVersionOverride' => false,
],
],
'pimcore' => [
'phpstan/phpstan' => [
'version' => '>=2.0',
Expand Down
2 changes: 1 addition & 1 deletion src/ProjectTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ProjectTypeResolver

/** @var array */
private $mapping = [
'drupal-bundle' => 'drupal',
'drupal-module' => 'drupal',
'drupal-project' => 'drupal',
'magento-project' => 'magento2',
'magento2-module' => 'magento2',
Expand Down
2 changes: 1 addition & 1 deletion templates/files/drupal/phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPCS</description>
<rule ref="./vendor/youwe/testing-suite/config/drupal" />
<rule ref="./vendor/youwe/testing-suite/config/drupal"/>
<!-- Append arg -s to phpcs to display the name of failed sniffs -->
<arg value="s"/>

Expand Down
4 changes: 4 additions & 0 deletions templates/mapping/project/drupal
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{drupal/,}grumphp.yml
{drupal/,}phpcs.xml
{drupal/,}phpmd.xml
{drupal/,}phpstan.neon
2 changes: 1 addition & 1 deletion tests/ProjectTypeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ProjectTypeResolverTest extends TestCase
* @throws Exception
*/
#[TestWith(data: ['some-type', 'default'], name: 'some-type')]
#[TestWith(data: ['drupal-bundle', 'drupal'], name: 'drupal-bundle')]
#[TestWith(data: ['drupal-module', 'drupal'], name: 'drupal-bundle')]
#[TestWith(data: ['drupal-project', 'drupal'], name: 'drupal-project')]
#[TestWith(data: ['magento-project', 'magento2'], name: 'magento-project')]
#[TestWith(data: ['magento2-module', 'magento2'], name: 'magento2-module')]
Expand Down
Loading