Skip to content

Commit

Permalink
Wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-net committed Sep 12, 2024
1 parent d1f6457 commit 33bc970
Show file tree
Hide file tree
Showing 7 changed files with 161 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/testing-suite.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Testing Suite
on: [push, workflow_dispatch]
jobs:
linter:
strategy:
matrix:
image: [
'srcoder/development-php:php82-fpm'
]
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Testing Suite
run: |
composer2 config http-basic.repo.magento.com ${{ secrets.MAGENTO_USERNAME }} ${{ secrets.MAGENTO_PASSWORD }}
composer2 install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv
composer2 show
vendor/bin/grumphp run --no-interaction
shell: bash
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"php": "^8.0",
"tweakwise/magento2-tweakwise": ">=8.0.0."
},
"require-dev": {
"youwe/coding-standard-magento2": "^2.0.0",
"youwe/testing-suite": "^2.17"
},
"autoload": {
"files": [
"src/registration.php"
Expand Down
90 changes: 90 additions & 0 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
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: ~

parallel:
enabled: true

# Default tasks for testing suite
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%'

phpcs:
standard: '%phpcs.standard%'
triggered_by: '%phpcs.triggered_by%'

phpmd:
exclude: '%phpmd.exclude%'
ruleset: '%phpmd.ruleset%'
triggered_by: '%phpmd.triggered_by%'
11 changes: 11 additions & 0 deletions pdepend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<symfony:container xmlns:symfony="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pdepend.org/schema/dic/pdepend"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<cache>
<driver>memory</driver>
</cache>
</config>
</symfony:container>
21 changes: 21 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<ruleset name="PHPCS"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>
<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->
<rule ref="YouweMagento2"/>

<!-- Commenting -->
<rule ref="Generic.Commenting.DocComment">
<exclude name="Generic.Commenting.DocComment.NonParamGroup"/>
<exclude name="Generic.Commenting.DocComment.SpacingAfterTagGroup"/>
</rule>

<!-- PhpUnit -->
<rule ref="GlobalPhpUnit.Coverage.CoversTag">
<exclude name="GlobalPhpUnit.Coverage.CoversTag.CoversTagMissing"/>
</rule>
</ruleset>
10 changes: 10 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PHPMD"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>PHPMD</description>
<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->
<rule ref="./vendor/youwe/coding-standard-magento2/src/YouweMagento2/phpmd.xml" />
</ruleset>
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
excludePaths:
# - %rootDir%/../../../path/to/exclude/*

0 comments on commit 33bc970

Please sign in to comment.