From 61ca9d47682e22eebdb22d076c5019ea384084f1 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Mon, 21 Apr 2025 16:28:25 +0100 Subject: [PATCH] Fix Markdown formatting issues in code-quality-checks.md - Added blank lines around fenced code blocks - Changed list markers from dashes to asterisks for consistency - Added language specification to code blocks - Fixed Markdown linting issues --- .ai-workflows/code-quality-checks.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.ai-workflows/code-quality-checks.md b/.ai-workflows/code-quality-checks.md index 26f857a..f8cb8d3 100644 --- a/.ai-workflows/code-quality-checks.md +++ b/.ai-workflows/code-quality-checks.md @@ -7,33 +7,43 @@ This document outlines the process for ensuring code quality before pushing chan Before pushing your changes to the repository, run through the following checks: 1. **Run Unit Tests** + ```bash composer test ``` + Ensure all tests pass. If any tests fail, fix the issues before proceeding. 2. **Run PHP CodeSniffer** + ```bash composer phpcs ``` + This will check your code against WordPress coding standards. Fix any issues before proceeding. 3. **Run PHP Code Beautifier and Fixer** + ```bash composer phpcbf ``` + This will automatically fix many coding standard issues. 4. **Run PHPStan** + ```bash composer phpstan ``` + This will perform static analysis on your code to find potential bugs and issues. 5. **Run PHP Mess Detector** + ```bash composer phpmd ``` + This will check for potential problems like unused variables, empty catch blocks, etc. ## Common Issues and How to Fix Them @@ -103,9 +113,9 @@ function_name( $param1, $param2 ); Follow WordPress naming conventions: -- Functions and variables: snake_case -- Classes: CamelCase -- Constants: UPPERCASE_WITH_UNDERSCORES +* Functions and variables: snake_case +* Classes: CamelCase +* Constants: UPPERCASE_WITH_UNDERSCORES ## Automated Checks in CI/CD @@ -128,7 +138,8 @@ You can use AI assistants to help improve code quality: 4. Run the checks again to verify the issues are resolved Example prompt: -``` + +```text I ran PHPCS and got the following errors. Can you help me fix them? [Paste error output here]