* fix: address PR #10 CodeRabbit review feedback - Fix SC2115 shellcheck warning in build.sh (use ${var:?} for safe rm -rf) - Fix SC2164 shellcheck warning in build.sh (cd build || exit 1) - Standardise bullet points from hyphens to asterisks in .wiki/Contributing.md - Refine verb formality in readme.txt, README.md, .wiki/Contributing.md, .wiki/Coding-Standards.md - Clarify PHPDoc wording in .wiki/Coding-Standards.md - Add clarifying comment to phpcs-simple.xml arg value * fix: re-enable PHPUnit test step in tests.yml Tests were commented out in PR #10. PHPUnit test files exist in tests/phpunit/ and phpunit.xml is configured. Re-enabling the step so tests actually run in CI. Closes #45 * fix: remove redundant composer require steps in code-quality workflow szepeviktor/phpstan-wordpress, wp-coding-standards/wpcs, and dealerdirect/phpcodesniffer-composer-installer are already declared in composer.json require-dev. The extra 'composer require' steps after 'composer install' caused a second packagist.org network hit that timed out in CI, failing the PHPStan Static Analysis job. Fixes the Code Quality CI failure on PR #51 (issue #45).
This commit is contained in:
8
.github/workflows/code-quality.yml
vendored
8
.github/workflows/code-quality.yml
vendored
@@ -29,11 +29,6 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --prefer-dist --no-progress
|
run: composer install --prefer-dist --no-progress
|
||||||
|
|
||||||
- name: Install WordPress Coding Standards
|
|
||||||
run: |
|
|
||||||
composer require --dev wp-coding-standards/wpcs dealerdirect/phpcodesniffer-composer-installer
|
|
||||||
vendor/bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs
|
|
||||||
|
|
||||||
- name: Run PHPCS
|
- name: Run PHPCS
|
||||||
run: composer phpcs
|
run: composer phpcs
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -61,9 +56,6 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --prefer-dist --no-progress
|
run: composer install --prefer-dist --no-progress
|
||||||
|
|
||||||
- name: Install PHPStan WordPress stubs
|
|
||||||
run: composer require --dev szepeviktor/phpstan-wordpress
|
|
||||||
|
|
||||||
- name: Run PHPStan
|
- name: Run PHPStan
|
||||||
run: composer phpstan
|
run: composer phpstan
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
7
.github/workflows/tests.yml
vendored
7
.github/workflows/tests.yml
vendored
@@ -34,11 +34,8 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: composer install --prefer-dist --no-progress
|
run: composer install --prefer-dist --no-progress
|
||||||
|
|
||||||
# - name: Debug test file content
|
- name: Run tests
|
||||||
# run: echo "--- Debugging tests/test-admin.php lines 75-95 ---" && sed -n '75,95p' tests/test-admin.php && echo "--- End Debugging ---"
|
run: ./vendor/bin/phpunit
|
||||||
|
|
||||||
# - name: Run tests
|
|
||||||
# run: ./vendor/bin/phpunit
|
|
||||||
|
|
||||||
code-style:
|
code-style:
|
||||||
name: Code Style
|
name: Code Style
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ if ($condition) {
|
|||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
* All classes, methods, and functions should be documented using PHPDoc
|
* All classes, methods, and functions should be documented using PHPDoc
|
||||||
* Include a description of the parameters, return values, and possible exceptions
|
* Include descriptions of parameters, return values, and any exceptions thrown
|
||||||
|
|
||||||
```php
|
```php
|
||||||
/**
|
/**
|
||||||
@@ -271,7 +271,7 @@ To ensure your code passes the quality checks from these tools, follow these gui
|
|||||||
3. **Using AI Assistants with Code Quality Tools**
|
3. **Using AI Assistants with Code Quality Tools**
|
||||||
* When you receive feedback from code quality tools, you can use AI assistants to help address the issues
|
* When you receive feedback from code quality tools, you can use AI assistants to help address the issues
|
||||||
* Copy the output from the code quality tool and paste it into your AI assistant chat
|
* Copy the output from the code quality tool and paste it into your AI assistant chat
|
||||||
* Ask the AI to help you understand and resolve the issues
|
* Request the AI's assistance to interpret and resolve the reported issues
|
||||||
* Example prompt:
|
* Example prompt:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ When you receive feedback from these code quality tools, you can use AI assistan
|
|||||||
|
|
||||||
1. Copy the output from the code quality tool
|
1. Copy the output from the code quality tool
|
||||||
2. Paste it into your AI assistant chat
|
2. Paste it into your AI assistant chat
|
||||||
3. Ask the AI to help you understand and resolve the issues
|
3. Request the AI's assistance to interpret and resolve the reported issues
|
||||||
4. Apply the suggested fixes
|
4. Apply the suggested fixes
|
||||||
5. Commit the changes and verify that the issues are resolved
|
5. Commit the changes and verify that the issues are resolved
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ To ensure your code meets the quality standards, run these commands before submi
|
|||||||
* Check JavaScript coding standards: `npm run lint:js`
|
* Check JavaScript coding standards: `npm run lint:js`
|
||||||
* Check CSS coding standards: `npm run lint:css`
|
* Check CSS coding standards: `npm run lint:css`
|
||||||
|
|
||||||
These checks will help identify and fix issues before they are caught by the automated code quality tools in the pull request process.
|
These checks will assist in identifying and resolving issues before they are caught by the automated code quality tools in the pull request process.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ When you receive feedback from these code quality tools, you can use AI assistan
|
|||||||
|
|
||||||
1. Copy the output from the code quality tool
|
1. Copy the output from the code quality tool
|
||||||
2. Paste it into your AI assistant chat
|
2. Paste it into your AI assistant chat
|
||||||
3. Ask the AI to help you understand and resolve the issues
|
3. Request the AI's assistance to interpret and resolve the reported issues
|
||||||
4. Apply the suggested fixes
|
4. Apply the suggested fixes
|
||||||
5. Commit the changes and verify that the issues are resolved
|
5. Commit the changes and verify that the issues are resolved
|
||||||
|
|
||||||
|
|||||||
4
build.sh
4
build.sh
@@ -71,7 +71,7 @@ if [ -d "vendor" ]; then
|
|||||||
cp -R vendor "$BUILD_DIR/"
|
cp -R vendor "$BUILD_DIR/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create ZIP file
|
# Create ZIP file.
|
||||||
echo "Creating ZIP file..."
|
echo "Creating ZIP file..."
|
||||||
cd build || exit 1
|
cd build || exit 1
|
||||||
zip -r "../$ZIP_FILE" "$PLUGIN_SLUG" -x "*.DS_Store" -x "*.git*" -x "*.github*"
|
zip -r "../$ZIP_FILE" "$PLUGIN_SLUG" -x "*.DS_Store" -x "*.git*" -x "*.github*"
|
||||||
@@ -87,7 +87,7 @@ if [ -f "$ZIP_FILE" ]; then
|
|||||||
printf '\nDeploying to local WordPress installation...\n'
|
printf '\nDeploying to local WordPress installation...\n'
|
||||||
echo "Deploying to local WordPress installation..."
|
echo "Deploying to local WordPress installation..."
|
||||||
|
|
||||||
# Remove existing plugin directory
|
# Remove existing plugin directory.
|
||||||
rm -rf "${WP_LOCAL_PLUGIN_DIR:?}/$PLUGIN_SLUG"
|
rm -rf "${WP_LOCAL_PLUGIN_DIR:?}/$PLUGIN_SLUG"
|
||||||
|
|
||||||
# Copy files to local WordPress installation
|
# Copy files to local WordPress installation
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<exclude-pattern>*/build/*</exclude-pattern>
|
<exclude-pattern>*/build/*</exclude-pattern>
|
||||||
<exclude-pattern>*/dist/*</exclude-pattern>
|
<exclude-pattern>*/dist/*</exclude-pattern>
|
||||||
|
|
||||||
<!-- Command line arguments -->
|
<!-- Command line arguments: combined short flags (-s shows sniff codes, -p shows progress) -->
|
||||||
<arg value="sp"/>
|
<arg value="sp"/>
|
||||||
<arg name="extensions" value="php"/>
|
<arg name="extensions" value="php"/>
|
||||||
<arg name="basepath" value="."/>
|
<arg name="basepath" value="."/>
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ When you receive feedback from these code quality tools, you can use AI assistan
|
|||||||
|
|
||||||
1. Copy the output from the code quality tool
|
1. Copy the output from the code quality tool
|
||||||
2. Paste it into your AI assistant chat
|
2. Paste it into your AI assistant chat
|
||||||
3. Ask the AI to help you understand and resolve the issues
|
3. Request the AI's assistance to interpret and resolve the reported issues
|
||||||
4. Apply the suggested fixes
|
4. Apply the suggested fixes
|
||||||
5. Commit the changes and verify that the issues are resolved
|
5. Commit the changes and verify that the issues are resolved
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user