Skip to content

Commit 07c5e4d

Browse files
unfrgivncig-bot
authored andcommitted
build: skip commit hooks in ci release
Committed via a GitHub action: https://github.com/itcig/itcig/actions/runs/1952763483
1 parent 3b828c7 commit 07c5e4d

File tree

5 files changed

+101
-3
lines changed

5 files changed

+101
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
### 0.2.19 (2022-03-08)
7+
8+
**Note:** Version bump only for package @itcig/php-coding-standards
9+
10+
11+
12+
13+
614
### [0.2.18](https://github.com/itcig/itcig/compare/@itcig/[email protected]...@itcig/[email protected]) (2022-02-23)
715

816
**Note:** Version bump only for package @itcig/php-coding-standards

README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,91 @@
11
# PHP Codesniffer Rulesets + Sniffs
2+
3+
Using CIG PHP coding standards ruleset for PHP*CodeSniffer, you can analyse the
4+
codebase of your project for PHP compatibility with other \_itcig* projects.
5+
6+
## What's in this repo ?
7+
8+
A ruleset for PHP*CodeSniffer to check for PHP compatibility and standards
9+
across all \_itcig* PHP projects.
10+
11+
This WordPress specific ruleset prevents false positives from the
12+
[PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility)
13+
by excluding back-fills and poly-fills which are provided by WordPress.
14+
15+
## Requirements
16+
17+
> These will all be installed automatically by this ruleset so you do not need
18+
> to include them explicitly.
19+
20+
- [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer). Use the
21+
latest stable release of
22+
[PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for the best
23+
results. The minimum _recommended_ version of PHP_CodeSniffer is version
24+
3.0.2.
25+
- [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility)
26+
9.0.0+.
27+
28+
## Installation instructions
29+
30+
The only supported installation method is via
31+
[Composer](https://getcomposer.org/).
32+
33+
If you already have a Composer PHP_CodeSniffer plugin installed, run:
34+
35+
```bash
36+
composer require --dev itcig/php-coding-standards:"*"
37+
composer install
38+
```
39+
40+
Next, run:
41+
42+
```bash
43+
vendor/bin/phpcs -i
44+
```
45+
46+
If all went well, you will now see that the `CIG`, `CIG-Docs`, `CIG-Wordpress`,
47+
`CIG-Core`, `PHPCompatibility`, `PHPCompatibilityWP` and some more
48+
PHPCompatibility standards are installed for PHP_CodeSniffer.
49+
50+
## How to use
51+
52+
Now you can use the following command to inspect your code:
53+
54+
```bash
55+
./vendor/bin/phpcs -p . --standard=CIG
56+
```
57+
58+
By default, you will only receive notifications about formatting and deprecated
59+
and/or removed PHP features.
60+
61+
To get the most out of the CIG coding and PHPCompatibility standards, you should
62+
specify a `testVersion` to check against. That will enable the checks for both
63+
deprecated/removed PHP features as well as the detection of code using new PHP
64+
features.
65+
66+
If you want to enforce the minimum PHP requirement, either add
67+
`--runtime-set testVersion 7.2-` to your command-line command or add
68+
`<config name="testVersion" value="7.2-"/>` to your
69+
[custom ruleset](https://github.com/PHPCompatibility/PHPCompatibility#using-a-custom-ruleset).
70+
71+
For example:
72+
73+
```bash
74+
# For a project which should be compatible with PHP 7.2 and higher:
75+
./vendor/bin/phpcs -p . --standard=CIG --runtime-set testVersion 7.2-
76+
```
77+
78+
For more detailed information about setting the `testVersion`, see the README of
79+
the generic
80+
[PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions)
81+
standard.
82+
83+
### Testing PHP files only
84+
85+
By default PHP_CodeSniffer will analyse PHP, JavaScript and CSS files. As the
86+
PHPCompatibility sniffs only target PHP code, you can make the run slightly
87+
faster by telling PHP_CodeSniffer to only check PHP files, like so:
88+
89+
```bash
90+
./vendor/bin/phpcs -p . --standard=CIG --extensions=php --runtime-set testVersion 7.2-
91+
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "itcig/php-coding-standards",
3-
"version": "0.2.18",
3+
"version": "0.2.19",
44
"type": "phpcodesniffer-standard",
55
"description": "PHP_CodeSniffer rules (sniffs) to enforce CIG coding conventions",
66
"keywords": [

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@itcig/php-coding-standards",
3-
"version": "0.2.18",
3+
"version": "0.2.19",
44
"license": "MIT",
55
"description": "PHP_CodeSniffer rules (sniffs) to enforce CIG coding conventions",
66
"author": {

0 commit comments

Comments
 (0)