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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Testing Suite
name: GrumPHP
on: [push]
jobs:
linter:
Expand All @@ -13,10 +13,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Testing Suite
- name: GrumPHP
run: |
composer2 config http-basic.repo.magento.com ${{ secrets.MAGENTO_USERNAME }} ${{ secrets.MAGENTO_PASSWORD }}
composer2 config gitlab-token.git.emico.io ${{ secrets.GITLAB_TOKEN }}
composer2 install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv
composer2 show
vendor/bin/grumphp run --no-interaction
vendor/bin/grumphp run --tasks=phpmd,phpcs,xmllint,phplint,composer --no-interaction
shell: bash
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.idea
/vendor
/composer.lock
/auth.json

/build/local.env
/build/data
3 changes: 3 additions & 0 deletions .grumphpinclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add all files which should be included in here.
# Patterns are equal to .gitignore
*.php
38 changes: 12 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
"magento/module-catalog": "^102.0||^103.0||^104.0"
},
"require-dev": {
"symfony/finder": "6.4.0",
"youwe/testing-suite": "^2.18",
"youwe/coding-standard-magento2": "^2.0.0",
"phpstan/extension-installer": "^1.3",
"bitexpert/phpstan-magento": "^0.30.1"
"emico/code-quality": "^10.5",
"symfony/finder": "6.4.0"
},
"prefer-stable": true,
"type": "magento2-module",
Expand All @@ -26,35 +23,24 @@
"Emico\\AttributeLanding\\": "src"
}
},
"repositories": [
{
"repositories": {
"magento": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"emico/code-quality": {
"type": "vcs",
"url": "https://git.emico.io/composer-packages/generic/codequality.git"
}
],
},
"config": {
"sort-packages": true,
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": true,
"youwe/coding-standard-phpstorm": true,
"phpro/grumphp-shim": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"youwe/testing-suite": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"phpro/grumphp": true,
"emico/code-quality": true
}
},
"archive": {
"exclude": [
"/.gitignore",
"/grumphp.yml",
"/pdepend.xml",
"/phpstan.neon",
"/phpunit.xml",
"/phpcs.xml",
"/phpmd.xml",
"/package.json",
"/.eslintrc.json",
"/.eslintignore"
]
}
}
124 changes: 39 additions & 85 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,44 @@
parameters:
# Default settings for php testing suite tasks
composer.strict: true

jsonlint.detect_key_conflicts: true

xmllint.load_from_net: true
xmllint.x_include: true
xmllint.dtd_validation: true
xmllint.scheme_validation: true
xmllint.triggered_by: [xml]
xmllint.ignore_patterns:
# Uses an incomplete definition, which conflicts when <exclude-pattern>
# is defined.
- /^phpcs.xml$/
- /^phpmd.xml$/
- /^phpunit.xml$/
- /^pdepend.xml$/

yamllint.parse_constant: true

phpcs.standard: ./phpcs.xml
phpcs.triggered_by: [php,phtml]

phplint.exclude: ['vendor']
phplint.jobs: ~
phplint.short_open_tag: false
phplint.ignore_patterns: [ ]
phplint.triggered_by: ['php']

phpmd.exclude: []
phpmd.ruleset:
- ./phpmd.xml
phpmd.triggered_by: [php]

phpstan.autoload_file: ~
phpstan.configuration: ./phpstan.neon
phpstan.level: 4
phpstan.triggered_by: [php]

phpunit.config_file: ./phpunit.xml

securitychecker.lockfile: ./composer.lock
securitychecker.run_always: true

git_blacklist.keywords:
- "die("
- "dd("
- "var_dump("
- "console.log("
- "print_r("
- "phpinfo("
- "exit("
- "exit;"
- "<<<<<<<"
- ">>>>>>>"
- "======="
- "<?php echo"
git_blacklist.triggered_by: [ 'php', 'js' ]
git_blacklist.whitelist_patterns: []
git_blacklist.regexp_type: G
git_blacklist.match_word: true
git_blacklist.ignore_patterns: []

grumphp:
ascii:
failed: ~
succeeded: ~

process_timeout: 360
extensions:
- Emico\CodeQuality\GrumPHP\Extension
parallel:
enabled: true

# Default tasks for testing suite
enabled: false
tasks:
xmllint:
load_from_net: '%xmllint.load_from_net%'
x_include: '%xmllint.x_include%'
dtd_validation: '%xmllint.dtd_validation%'
scheme_validation: '%xmllint.scheme_validation%'
triggered_by: '%xmllint.triggered_by%'
ignore_patterns: '%xmllint.ignore_patterns%'

phpstan:
triggered_by:
- php
level: 7
configuration: phpstan.neon
phpmd:
triggered_by:
- php
ruleset:
- "ruleset.xml"
phpcs:
standard: '%phpcs.standard%'
triggered_by: '%phpcs.triggered_by%'
triggered_by:
- php

phpmd:
exclude: '%phpmd.exclude%'
ruleset: '%phpmd.ruleset%'
triggered_by: '%phpmd.triggered_by%'
xmllint:
triggered_by: [ 'xml', 'xsd' ]
scheme_validation: true
x_include: true
dtd_validation: true
load_from_net: true

phplint:
short_open_tag: true

composer:
no_check_publish: true
with_dependencies: false
strict: false

git_commit_message:
allow_empty_message: false
enforce_capitalized_subject: false
enforce_no_subject_punctuations: false
enforce_no_subject_trailing_period: false
enforce_single_lined_subject: true
max_body_width: 100
max_subject_width: 100
11 changes: 0 additions & 11 deletions pdepend.xml

This file was deleted.

15 changes: 0 additions & 15 deletions phpcs.xml

This file was deleted.

1 change: 1 addition & 0 deletions phpcs.xml
10 changes: 0 additions & 10 deletions phpmd.xml

This file was deleted.

28 changes: 26 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
services:
- class: Emico\CodeQuality\PHPStan\VarModelExtension
tags:
- phpstan.broker.methodsClassReflectionExtension

parameters:
excludePaths:
# - %rootDir%/../../../path/to/exclude/*
ignoreErrors:
- '/Call to an undefined method Mockery\\ExpectationInterface|Mockery\\HigherOrderMessage::andReturnUsing\(\)./'
- '/expects string, Magento\\Framework\\Phrase given/'
- identifier: missingType.iterableValue
- identifier: missingType.generics
- messages:
- '/::delete\(\) expects Magento\\Framework\\Model\\AbstractModel,/'
- '/::save\(\) expects Magento\\Framework\\Model\\AbstractModel,/'
- '/::load\(\) expects Magento\\Framework\\Model\\AbstractModel,/'
path: *Repository.php
stubFiles:
- ./vendor/emico/code-quality/phpstan/stubs/globalFunctions.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/Catalog/Model/ResourceModel/Product/Collection.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/Eav/Setup/EavSetup.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/Framework/Api/Search/FilterGroupBuilder.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/Framework/App/ActionFlag.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/Framework/Escaper.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/Framework/Serialize/SerializerInterface.stub
- ./vendor/emico/code-quality/phpstan/stubs/Magento/InventoryImportExport/Model/Import/Serializer/Json.stub
bootstrapFiles:
- ../../autoload.php
1 change: 1 addition & 0 deletions ruleset.xml
2 changes: 1 addition & 1 deletion src/Api/Data/FilterInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

/**
* @author Bram Gerritsen <bgerritsen@emico.nl>
Expand Down
10 changes: 5 additions & 5 deletions src/Api/Data/LandingPageInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

/**
* @author Bram Gerritsen <bgerritsen@emico.nl>
Expand Down Expand Up @@ -72,7 +72,7 @@ public function isActive(): bool;

/**
* Get name
* @return string|null
* @return string
*/
public function getName(): string;

Expand Down Expand Up @@ -167,7 +167,7 @@ public function setFilterAttributes(?string $filterAttributes): LandingPageInter
public function getFilters(): array;

/**
* @return mixed
* @return array
*/
public function getUnserializedFilterAttributes(): array;

Expand All @@ -183,13 +183,13 @@ public function getOverviewPageImage();

/**
* @return bool
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
* @SuppressWarnings("PHPMD.BooleanGetMethodName")
*/
public function getIsFilterLinkAllowed(): bool;

/**
* @return bool
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
* @SuppressWarnings("PHPMD.BooleanGetMethodName")
*/
public function getHideSelectedFilters(): bool;

Expand Down
2 changes: 1 addition & 1 deletion src/Api/Data/OverviewPageInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

/**
* @author Bram Gerritsen <bgerritsen@emico.nl>
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Data/OverviewPageSearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

/**
* @author Bram Gerritsen <bgerritsen@emico.nl>
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Data/PageSearchResultsInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

/**
* @author Bram Gerritsen <bgerritsen@emico.nl>
Expand Down
2 changes: 1 addition & 1 deletion src/Api/LandingPageRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace Emico\AttributeLanding\Api;

Expand Down
2 changes: 1 addition & 1 deletion src/Api/OverviewPageRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace Emico\AttributeLanding\Api;

Expand Down
2 changes: 1 addition & 1 deletion src/Api/UrlRewriteGeneratorInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

/**
* @author Bram Gerritsen <bgerritsen@emico.nl>
Expand Down
2 changes: 1 addition & 1 deletion src/Block/Adminhtml/OverviewPage/Edit/BackButton.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace Emico\AttributeLanding\Block\Adminhtml\OverviewPage\Edit;

Expand Down
2 changes: 1 addition & 1 deletion src/Block/Adminhtml/OverviewPage/Edit/DeleteButton.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace Emico\AttributeLanding\Block\Adminhtml\OverviewPage\Edit;

Expand Down
2 changes: 1 addition & 1 deletion src/Block/Adminhtml/OverviewPage/Edit/GenericButton.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace Emico\AttributeLanding\Block\Adminhtml\OverviewPage\Edit;

Expand Down
Loading