Skip to content

Commit

Permalink
OXDEV-7729 Add phpmd and synchronize tools running commands from modu…
Browse files Browse the repository at this point in the history
…le template

Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed Jan 31, 2024
1 parent ed3b6b3 commit 4ce5b38
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
28 changes: 21 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"phpstan/phpstan": "^1.8.11",
"phpunit/phpunit": "^10.4",
"oxid-esales/oxideshop-ce": "dev-b-7.1.x",
"mikey179/vfsstream": "~1.6.8"
"mikey179/vfsstream": "~1.6.8",
"phpmd/phpmd": "^2.15"
},
"autoload": {
"psr-4": {
Expand All @@ -38,21 +39,34 @@
}
},
"scripts": {
"phpcs": "phpcs --standard=tests/phpcs.xml",
"phpcs": "phpcs --standard=tests/phpcs.xml --report=full",
"phpcs-report": "phpcs --standard=tests/phpcs.xml --report=json --report-file=phpcs.report.json",
"phpcbf": "phpcbf --standard=tests/phpcs.xml",

"phpstan": "phpstan -ctests/PhpStan/phpstan.neon analyse src/",
"phpstan-report": "phpstan -ctests/PhpStan/phpstan.neon analyse src/ --error-format=json > phpstan.report.json",
"phpstan-report": "phpstan -ctests/PhpStan/phpstan.neon analyse src/ --error-format=json >phpstan.report.json",

"phpmd": "phpmd src ansi tests/PhpMd/standard.xml --ignore-errors-on-exit --ignore-violations-on-exit",
"phpmd-excludestaticaccess": "phpmd src ansi tests/PhpMd/exclude-static-access-rule.xml",
"phpmd-report": "phpmd src json tests/PhpMd/standard.xml --ignore-errors-on-exit --ignore-violations-on-exit --reportfile phpmd.report.json",

"static": [
"@phpcs",
"@phpstan"
"@phpstan",
"@phpmd"
],

"phpunit": "vendor/bin/phpunit --bootstrap=/var/www/source/bootstrap.php --config=tests/",
"phpunit-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --bootstrap=/var/www/source/bootstrap.php --config=tests/ --coverage-html=tests/result/coverage",
"tests-unit": "vendor/bin/phpunit --config=tests/ --testsuite=Unit",
"tests-integration": "vendor/bin/phpunit --bootstrap=/var/www/source/bootstrap.php --config=tests/ --testsuite=Integration",
"tests-coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --bootstrap=/var/www/source/bootstrap.php --config=tests/ --coverage-html=tests/result/coverage",

"tests-codeception": "THEME_ID=apex MODULE_IDS=ddoemedialibrary /var/www/vendor/bin/codecept run acceptance -c /var/www/vendor/oxid-esales/media-library-module/tests/codeception.yml",

"codeception": "THEME_ID=apex MODULE_IDS=ddoemedialibrary /var/www/vendor/bin/codecept run acceptance -c /var/www/vendor/oxid-esales/media-library-module/tests/codeception.yml"
"tests-all": [
"@tests-unit",
"@tests-integration",
"@tests-codeception"
]
},
"config": {
"allow-plugins": {
Expand Down
18 changes: 18 additions & 0 deletions tests/PhpMd/standard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<ruleset name="Standard PHPMD rule set for Oxid"
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>
Standard OXID Ruleset
</description>

<rule ref="rulesets/codesize.xml" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml" />
<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/cleancode.xml" />
</ruleset>

0 comments on commit 4ce5b38

Please sign in to comment.