Skip to content

Commit

Permalink
Lay the groundwork for applying WordPress coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Mar 19, 2024
1 parent bce6066 commit 3506ef4
Show file tree
Hide file tree
Showing 6 changed files with 569 additions and 45 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,23 @@ To try the built .phar file, run:
rm -rf new-wp/* && USE_PHAR=1 php blueprint_compiling.php
```

## Coding Standards

This project uses
the [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/) and
PHPCS to enforce them. To check the code for compliance, run:

```shell
composer run-script phpcs
```

To automatically fix the code to comply with the standards, run:

```shell
composer run-script phpcbf
composer run-script phpcs-fix
```

## PHP 7.0 Compatibility

This project is compatible with PHP >= 7.0.
Expand Down
8 changes: 6 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"jane-php/json-schema": "*",
"bamarni/composer-bin-plugin": "*",
"wp-coding-standards/wpcs": "3.0",
"phpcompatibility/php-compatibility": "^9.3"
"phpcompatibility/php-compatibility": "^9.3",
"friendsofphp/php-cs-fixer": "^3.52"
},
"config": {
"optimize-autoloader": true,
Expand Down Expand Up @@ -53,6 +54,9 @@
]
},
"scripts": {
"phpcs": "phpcs --standard=WordPress"
"test": "phpunit",
"phpcs": "phpcs ./src/WordPress -s",
"phpcs-fixer": "php-cs-fixer fix ./src/WordPress",
"phpcbf": "phpcbf ./src/WordPress"
}
}
Loading

0 comments on commit 3506ef4

Please sign in to comment.