Standardize Markdown bullet points to use asterisks instead of hyphens
This commit is contained in:
@@ -8,40 +8,40 @@ This plugin follows the [WordPress Coding Standards](https://developer.wordpress
|
||||
|
||||
### File Structure
|
||||
|
||||
- Each PHP file should begin with the PHP opening tag `<?php` (no closing tag)
|
||||
- Files should use the Unix line endings (LF)
|
||||
- Files should be encoded in UTF-8 without BOM
|
||||
* Each PHP file should begin with the PHP opening tag `<?php` (no closing tag)
|
||||
* Files should use the Unix line endings (LF)
|
||||
* Files should be encoded in UTF-8 without BOM
|
||||
|
||||
### Naming Conventions
|
||||
|
||||
- **Classes**: Use `PascalCase` for class names
|
||||
* **Classes**: Use `PascalCase` for class names
|
||||
```php
|
||||
class MyClassName {}
|
||||
```
|
||||
|
||||
- **Methods and Functions**: Use `snake_case` for method and function names
|
||||
* **Methods and Functions**: Use `snake_case` for method and function names
|
||||
```php
|
||||
function my_function_name() {}
|
||||
public function my_method_name() {}
|
||||
```
|
||||
|
||||
- **Variables**: Use `snake_case` for variable names
|
||||
* **Variables**: Use `snake_case` for variable names
|
||||
```php
|
||||
$my_variable_name = 'value';
|
||||
```
|
||||
|
||||
- **Constants**: Use `UPPERCASE_WITH_UNDERSCORES` for constants
|
||||
* **Constants**: Use `UPPERCASE_WITH_UNDERSCORES` for constants
|
||||
```php
|
||||
define('MY_CONSTANT', 'value');
|
||||
const MY_CLASS_CONSTANT = 'value';
|
||||
```
|
||||
|
||||
- **Namespaces**: Use `PascalCase` for namespace segments
|
||||
* **Namespaces**: Use `PascalCase` for namespace segments
|
||||
```php
|
||||
namespace WPALLSTARS\PluginStarterTemplate;
|
||||
```
|
||||
|
||||
- **Hooks**: Prefix hooks with the plugin's prefix
|
||||
* **Hooks**: Prefix hooks with the plugin's prefix
|
||||
```php
|
||||
do_action('wpst_hook_name');
|
||||
apply_filters('wpst_filter_name', $value);
|
||||
@@ -49,10 +49,10 @@ This plugin follows the [WordPress Coding Standards](https://developer.wordpress
|
||||
|
||||
### Indentation and Formatting
|
||||
|
||||
- Use 4 spaces for indentation (not tabs)
|
||||
- Opening braces for classes and functions should be on the same line
|
||||
- Control structures should have one space between the statement and the opening parenthesis
|
||||
- Each line should be no longer than 100 characters
|
||||
* Use 4 spaces for indentation (not tabs)
|
||||
* Opening braces for classes and functions should be on the same line
|
||||
* Control structures should have one space between the statement and the opening parenthesis
|
||||
* Each line should be no longer than 100 characters
|
||||
|
||||
```php
|
||||
if ($condition) {
|
||||
@@ -66,8 +66,8 @@ if ($condition) {
|
||||
|
||||
### Documentation
|
||||
|
||||
- All classes, methods, and functions should be documented using PHPDoc
|
||||
- Include a description, parameters, return values, and exceptions
|
||||
* All classes, methods, and functions should be documented using PHPDoc
|
||||
* Include a description, parameters, return values, and exceptions
|
||||
|
||||
```php
|
||||
/**
|
||||
@@ -87,9 +87,9 @@ function my_function($param1, $param2) {
|
||||
|
||||
### Object-Oriented Programming
|
||||
|
||||
- Each class should have a single responsibility
|
||||
- Use visibility declarations for all properties and methods (public, protected, private)
|
||||
- Use type hints for parameters and return types when possible
|
||||
* Each class should have a single responsibility
|
||||
* Use visibility declarations for all properties and methods (public, protected, private)
|
||||
* Use type hints for parameters and return types when possible
|
||||
|
||||
```php
|
||||
class MyClass {
|
||||
@@ -118,22 +118,22 @@ This plugin follows the [WordPress JavaScript Coding Standards](https://develope
|
||||
|
||||
### Naming Conventions
|
||||
|
||||
- **Variables and Functions**: Use `camelCase` for variable and function names
|
||||
* **Variables and Functions**: Use `camelCase` for variable and function names
|
||||
```javascript
|
||||
var myVariableName = 'value';
|
||||
function myFunctionName() {}
|
||||
```
|
||||
|
||||
- **Constants**: Use `UPPERCASE_WITH_UNDERSCORES` for constants
|
||||
* **Constants**: Use `UPPERCASE_WITH_UNDERSCORES` for constants
|
||||
```javascript
|
||||
var MY_CONSTANT = 'value';
|
||||
```
|
||||
|
||||
### Indentation and Formatting
|
||||
|
||||
- Use 4 spaces for indentation (not tabs)
|
||||
- Opening braces should be on the same line as the statement
|
||||
- Each line should be no longer than 100 characters
|
||||
* Use 4 spaces for indentation (not tabs)
|
||||
* Opening braces should be on the same line as the statement
|
||||
* Each line should be no longer than 100 characters
|
||||
|
||||
```javascript
|
||||
if (condition) {
|
||||
@@ -147,7 +147,7 @@ if (condition) {
|
||||
|
||||
### Documentation
|
||||
|
||||
- Use JSDoc for documenting functions and objects
|
||||
* Use JSDoc for documenting functions and objects
|
||||
|
||||
```javascript
|
||||
/**
|
||||
@@ -168,9 +168,9 @@ This plugin follows the [WordPress CSS Coding Standards](https://developer.wordp
|
||||
|
||||
### Naming Conventions
|
||||
|
||||
- Use lowercase for selectors
|
||||
- Use hyphens to separate words in class and ID names
|
||||
- Prefix classes and IDs with the plugin's prefix
|
||||
* Use lowercase for selectors
|
||||
* Use hyphens to separate words in class and ID names
|
||||
* Prefix classes and IDs with the plugin's prefix
|
||||
|
||||
```css
|
||||
.wpst-container {
|
||||
@@ -184,11 +184,11 @@ This plugin follows the [WordPress CSS Coding Standards](https://developer.wordp
|
||||
|
||||
### Indentation and Formatting
|
||||
|
||||
- Use 4 spaces for indentation (not tabs)
|
||||
- Each property should be on its own line
|
||||
- Include a space after the colon in property declarations
|
||||
- End each declaration with a semicolon
|
||||
- Use single quotes for attribute selectors and property values
|
||||
* Use 4 spaces for indentation (not tabs)
|
||||
* Each property should be on its own line
|
||||
* Include a space after the colon in property declarations
|
||||
* End each declaration with a semicolon
|
||||
* Use single quotes for attribute selectors and property values
|
||||
|
||||
```css
|
||||
.wpst-container {
|
||||
@@ -229,54 +229,55 @@ This plugin uses automated tools to enforce coding standards:
|
||||
This project integrates with several code quality tools that automatically analyze your code when you create a pull request. These tools are free for public repositories and should be integrated into any new repositories based on this template.
|
||||
|
||||
1. **CodeRabbit**: AI-powered code review tool
|
||||
- Provides automated feedback on pull requests
|
||||
- Identifies potential issues and suggests improvements
|
||||
- [Website](https://www.coderabbit.ai/)
|
||||
* Provides automated feedback on pull requests
|
||||
* Identifies potential issues and suggests improvements
|
||||
* [Website](https://www.coderabbit.ai/)
|
||||
|
||||
2. **CodeFactor**: Continuous code quality monitoring
|
||||
- Provides a grade for your codebase
|
||||
- Identifies issues related to code style, complexity, and potential bugs
|
||||
- Tracks code quality over time
|
||||
- [Website](https://www.codefactor.io/)
|
||||
* Provides a grade for your codebase
|
||||
* Identifies issues related to code style, complexity, and potential bugs
|
||||
* Tracks code quality over time
|
||||
* [Website](https://www.codefactor.io/)
|
||||
|
||||
3. **Codacy**: Code quality and static analysis
|
||||
- Provides a grade for your codebase
|
||||
- Identifies issues related to code style, security, and performance
|
||||
- Tracks code quality over time
|
||||
- [Website](https://www.codacy.com/)
|
||||
* Provides a grade for your codebase
|
||||
* Identifies issues related to code style, security, and performance
|
||||
* Tracks code quality over time
|
||||
* [Website](https://www.codacy.com/)
|
||||
|
||||
4. **SonarCloud**: Code quality and security analysis
|
||||
- Provides detailed analysis of code quality
|
||||
- Identifies security vulnerabilities and technical debt
|
||||
- Tracks code quality over time
|
||||
- [Website](https://sonarcloud.io/)
|
||||
* Provides detailed analysis of code quality
|
||||
* Identifies security vulnerabilities and technical debt
|
||||
* Tracks code quality over time
|
||||
* [Website](https://sonarcloud.io/)
|
||||
|
||||
### How to Pass Code Quality Checks
|
||||
|
||||
To ensure your code passes the quality checks from these tools, follow these guidelines:
|
||||
|
||||
1. **Run Local Checks First**
|
||||
- Before pushing your code, run PHPCS and PHPCBF locally
|
||||
- Fix any issues identified by these tools
|
||||
* Before pushing your code, run PHPCS and PHPCBF locally
|
||||
* Fix any issues identified by these tools
|
||||
|
||||
2. **Address Common Issues**
|
||||
- **Indentation**: Use 4 spaces for indentation (not tabs)
|
||||
- **Line Length**: Keep lines under 100 characters
|
||||
- **Naming Conventions**: Follow WordPress naming conventions
|
||||
- **Documentation**: Add PHPDoc comments to classes, methods, and functions
|
||||
- **Error Handling**: Implement proper error handling
|
||||
- **Security**: Validate and sanitize input, escape output
|
||||
* **Indentation**: Use 4 spaces for indentation (not tabs)
|
||||
* **Line Length**: Keep lines under 100 characters
|
||||
* **Naming Conventions**: Follow WordPress naming conventions
|
||||
* **Documentation**: Add PHPDoc comments to classes, methods, and functions
|
||||
* **Error Handling**: Implement proper error handling
|
||||
* **Security**: Validate and sanitize input, escape output
|
||||
* **Markdown**: Use asterisks (*) for bullet points, not hyphens (-)
|
||||
|
||||
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
|
||||
- Copy the output from the code quality tool and paste it into your AI assistant chat
|
||||
- Ask the AI to help you understand and fix the issues
|
||||
- Example prompt: "I received the following feedback from [Tool Name]. Please help me understand these issues and suggest fixes: [Paste the tool output here]"
|
||||
* 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
|
||||
* Ask the AI to help you understand and fix the issues
|
||||
* Example prompt: "I received the following feedback from [Tool Name]. Please help me understand these issues and suggest fixes: [Paste the tool output here]"
|
||||
|
||||
4. **Iterative Improvement**
|
||||
- Address issues one at a time, starting with the most critical
|
||||
- Commit and push your changes to see if they resolve the issues
|
||||
- Continue this process until all issues are resolved
|
||||
* Address issues one at a time, starting with the most critical
|
||||
* Commit and push your changes to see if they resolve the issues
|
||||
* Continue this process until all issues are resolved
|
||||
|
||||
## Conclusion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user