- .markdownlint.json: enforce MD004 asterisk style to match project conventions
- .wiki/Contributing.md: convert all dash list markers to asterisks (MD004)
- .wiki/Coding-Standards.md: fix PHPDoc bullet wording (add missing preposition)
- build.sh: add set -euo pipefail for strict error handling
- build.sh: fix SC2115 (use ${var:?} to prevent rm -rf /)
- build.sh: fix SC2164 (cd build || exit 1)
- build.sh: fix SC2028 (use printf instead of echo for escape sequences)
- build.sh: fix SC2035 (use ./*.php glob to avoid dash-named files)
Closes #46
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"MD004": {
|
||||
"style": "asterisk"
|
||||
},
|
||||
"MD012": false,
|
||||
"MD022": false,
|
||||
"MD031": false,
|
||||
|
||||
@@ -67,7 +67,7 @@ if ($condition) {
|
||||
### Documentation
|
||||
|
||||
* All classes, methods, and functions should be documented using PHPDoc
|
||||
* Include a description, parameters, return values, and exceptions
|
||||
* Include a description of the parameters, return values, and possible exceptions
|
||||
|
||||
```php
|
||||
/**
|
||||
|
||||
@@ -6,11 +6,11 @@ Thank you for considering contributing to this project! This document provides g
|
||||
|
||||
By participating in this project, you agree to abide by our code of conduct:
|
||||
|
||||
- Be respectful and inclusive
|
||||
- Be patient and welcoming
|
||||
- Be considerate
|
||||
- Be collaborative
|
||||
- Be open-minded
|
||||
* Be respectful and inclusive
|
||||
* Be patient and welcoming
|
||||
* Be considerate
|
||||
* Be collaborative
|
||||
* Be open-minded
|
||||
|
||||
## How to Contribute
|
||||
|
||||
@@ -26,12 +26,12 @@ If you find a bug, please report it by creating an issue on GitHub:
|
||||
|
||||
Please include:
|
||||
|
||||
- A clear, descriptive title
|
||||
- Steps to reproduce the bug
|
||||
- Expected behavior
|
||||
- Actual behavior
|
||||
- Screenshots (if applicable)
|
||||
- Your environment (WordPress version, PHP version, browser, etc.)
|
||||
* A clear, descriptive title
|
||||
* Steps to reproduce the bug
|
||||
* Expected behavior
|
||||
* Actual behavior
|
||||
* Screenshots (if applicable)
|
||||
* Your environment (WordPress version, PHP version, browser, etc.)
|
||||
|
||||
### Suggesting Enhancements
|
||||
|
||||
@@ -45,10 +45,10 @@ If you have an idea for an enhancement:
|
||||
|
||||
Please include:
|
||||
|
||||
- A clear, descriptive title
|
||||
- A detailed description of the enhancement
|
||||
- Why this enhancement would be useful
|
||||
- Any relevant examples or mockups
|
||||
* A clear, descriptive title
|
||||
* A detailed description of the enhancement
|
||||
* Why this enhancement would be useful
|
||||
* Any relevant examples or mockups
|
||||
|
||||
### Pull Requests
|
||||
|
||||
@@ -72,33 +72,33 @@ If you want to contribute code:
|
||||
|
||||
#### Pull Request Guidelines
|
||||
|
||||
- Follow the coding standards (see [Coding Standards](Coding-Standards))
|
||||
- Write tests for your changes
|
||||
- Update documentation as needed
|
||||
- Keep pull requests focused on a single change
|
||||
- Write a clear, descriptive title and description
|
||||
- Reference any related issues
|
||||
- Ensure your code passes the automated code quality checks (see below)
|
||||
* Follow the coding standards (see [Coding Standards](Coding-Standards))
|
||||
* Write tests for your changes
|
||||
* Update documentation as needed
|
||||
* Keep pull requests focused on a single change
|
||||
* Write a clear, descriptive title and description
|
||||
* Reference any related issues
|
||||
* Ensure your code passes the automated code quality checks (see below)
|
||||
|
||||
#### Code Quality Tools
|
||||
|
||||
This project uses several automated code quality tools to ensure high standards. These tools are free for public repositories and will automatically analyze your code when you create a pull request:
|
||||
|
||||
1. **CodeRabbit**: AI-powered code review tool
|
||||
- [Website](https://www.coderabbit.ai/)
|
||||
- Provides automated feedback on pull requests
|
||||
* [Website](https://www.coderabbit.ai/)
|
||||
* Provides automated feedback on pull requests
|
||||
|
||||
2. **CodeFactor**: Continuous code quality monitoring
|
||||
- [Website](https://www.codefactor.io/)
|
||||
- Provides a grade for your codebase
|
||||
* [Website](https://www.codefactor.io/)
|
||||
* Provides a grade for your codebase
|
||||
|
||||
3. **Codacy**: Code quality and static analysis
|
||||
- [Website](https://www.codacy.com/)
|
||||
- Identifies issues related to code style, security, and performance
|
||||
* [Website](https://www.codacy.com/)
|
||||
* Identifies issues related to code style, security, and performance
|
||||
|
||||
4. **SonarCloud**: Code quality and security analysis
|
||||
- [Website](https://sonarcloud.io/)
|
||||
- Provides detailed analysis of code quality and security
|
||||
* [Website](https://sonarcloud.io/)
|
||||
* Provides detailed analysis of code quality and security
|
||||
|
||||
#### Using AI Assistants with Code Quality Tools
|
||||
|
||||
|
||||
9
build.sh
9
build.sh
@@ -1,4 +1,5 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# WordPress Plugin Build Script
|
||||
# This script creates a clean build of the plugin for distribution
|
||||
@@ -39,7 +40,7 @@ composer install --no-dev --optimize-autoloader
|
||||
|
||||
# Copy plugin files to build directory
|
||||
echo "Copying plugin files..."
|
||||
cp -R *.php "$BUILD_DIR/"
|
||||
cp -R ./*.php "$BUILD_DIR/"
|
||||
cp -R README.md LICENSE CHANGELOG.md readme.txt composer.json "$BUILD_DIR/"
|
||||
|
||||
# Copy directories
|
||||
@@ -72,7 +73,7 @@ fi
|
||||
|
||||
# Create ZIP file
|
||||
echo "Creating ZIP file..."
|
||||
cd build
|
||||
cd build || exit 1
|
||||
zip -r "../$ZIP_FILE" "$PLUGIN_SLUG" -x "*.DS_Store" -x "*.git*" -x "*.github*"
|
||||
cd ..
|
||||
|
||||
@@ -83,11 +84,11 @@ if [ -f "$ZIP_FILE" ]; then
|
||||
|
||||
# Deploy to local WordPress installation if environment variable is set
|
||||
if [ -n "$WP_LOCAL_PLUGIN_DIR" ]; then
|
||||
echo "\nDeploying to local WordPress installation..."
|
||||
printf '\nDeploying to local WordPress installation...\n'
|
||||
echo "Deploying to local WordPress installation..."
|
||||
|
||||
# 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
|
||||
rsync -av --exclude=".git" --exclude=".github" --exclude=".DS_Store" \
|
||||
|
||||
Reference in New Issue
Block a user