Enhance CI/CD workflow with code quality checks and PHPCBF integration

This commit is contained in:
2025-04-21 04:02:27 +01:00
parent 497c44c3c6
commit 5cd2a7d374
6 changed files with 152 additions and 12 deletions

View File

@@ -41,7 +41,7 @@ This workspace may contain multiple repository folders. Always focus ONLY on the
This project follows the [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/):
- Use tabs for indentation, not spaces
- Use 4 spaces for indentation, not tabs (this is a project-specific override of WordPress standards)
- Follow WordPress naming conventions:
- Class names: `Class_Name`
- Function names: `function_name`
@@ -51,6 +51,38 @@ This project follows the [WordPress Coding Standards](https://developer.wordpres
- Validate and sanitize all inputs
- Escape all outputs
### Code Quality Tools
This project uses several automated code quality tools to ensure high standards:
1. **PHP_CodeSniffer (PHPCS)**: Checks PHP code against the WordPress Coding Standards
```bash
composer run phpcs
```
2. **PHP Code Beautifier and Fixer (PHPCBF)**: Automatically fixes some coding standard violations
```bash
composer run phpcbf
```
3. **ESLint**: Checks JavaScript code against the WordPress Coding Standards
```bash
npm run lint:js
```
4. **Stylelint**: Checks CSS code against the WordPress Coding Standards
```bash
npm run lint:css
```
5. **Continuous Integration Tools**: The project integrates with several code quality tools:
- **CodeRabbit**: AI-powered code review tool
- **CodeFactor**: Continuous code quality monitoring
- **Codacy**: Code quality and static analysis
- **SonarCloud**: Code quality and security analysis
Always run PHPCS and PHPCBF locally before committing code to ensure it meets the project's coding standards.
## Common Tasks
For detailed instructions on common tasks like creating releases, adding features, fixing bugs, and testing previous versions, see **@.ai-workflows/release-process.md**.