Fix code quality tools configuration and workflow

- Fix PHP CodeSniffer configuration to use WordPress coding standards
- Add WordPress stubs to PHPStan configuration
- Fix Codacy Analysis action by removing unsupported parameter
- Update SonarCloud action to use recommended sonarqube-scan-action
- Add comprehensive documentation for code quality tools
- Update composer scripts to use vendor binaries
This commit is contained in:
2025-04-21 14:45:27 +01:00
parent 3048e91a78
commit 19ec65326b
6 changed files with 237 additions and 68 deletions

View File

@@ -21,6 +21,7 @@
"wp-coding-standards/wpcs": "^3.0",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"phpstan/phpstan": "^1.10.0",
"szepeviktor/phpstan-wordpress": "^1.3",
"phpmd/phpmd": "^2.13.0",
"symfony/dependency-injection": "^5.4",
"symfony/config": "^5.4",
@@ -45,13 +46,13 @@
}
},
"scripts": {
"phpcs": "phpcs --standard=phpcs.xml",
"phpcs:simple": "phpcs --standard=phpcs-simple.xml",
"phpcbf": "phpcbf --standard=phpcs.xml",
"phpcbf:simple": "phpcbf --standard=phpcs-simple.xml",
"phpstan": "phpstan analyse --level=5 .",
"phpmd": "phpmd . text cleancode,codesize,controversial,design,naming,unusedcode --exclude vendor,node_modules,tests,bin,build,dist",
"test": "phpunit",
"phpcs": "vendor/bin/phpcs --standard=phpcs.xml",
"phpcs:simple": "vendor/bin/phpcs --standard=phpcs-simple.xml",
"phpcbf": "vendor/bin/phpcbf --standard=phpcs.xml",
"phpcbf:simple": "vendor/bin/phpcbf --standard=phpcs-simple.xml",
"phpstan": "vendor/bin/phpstan analyse --level=5 .",
"phpmd": "vendor/bin/phpmd . text cleancode,codesize,controversial,design,naming,unusedcode --exclude vendor,node_modules,tests,bin,build,dist",
"test": "vendor/bin/phpunit",
"lint": ["@phpcs", "@phpstan", "@phpmd"],
"fix": ["@phpcbf"]
}