Skip to content

Commit 4255c03

Browse files
committed
Next-gen coding standard workflow
1 parent f45734b commit 4255c03

File tree

9 files changed

+21
-464
lines changed

9 files changed

+21
-464
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ tmp export-ignore
66
.gitattributes export-ignore
77
.gitignore export-ignore
88
Makefile export-ignore
9-
phpcs.xml export-ignore
109
phpstan.neon export-ignore
1110
phpunit.xml export-ignore

.github/renovate.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
"enabled": true,
1515
"groupName": "root-composer"
1616
},
17-
{
18-
"matchPaths": ["build-cs/**"],
19-
"enabled": true,
20-
"groupName": "build-cs"
21-
},
2217
{
2318
"matchPaths": [".github/**"],
2419
"enabled": true,

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: "Lint"
4343
run: "make lint"
4444

45-
coding-standards:
45+
coding-standard:
4646
name: "Coding Standard"
4747

4848
runs-on: "ubuntu-latest"
@@ -51,18 +51,28 @@ jobs:
5151
- name: "Checkout"
5252
uses: actions/checkout@v3
5353

54+
- name: "Checkout build-cs"
55+
uses: actions/checkout@v3
56+
with:
57+
repository: "phpstan/build-cs"
58+
path: "build-cs"
59+
5460
- name: "Install PHP"
5561
uses: "shivammathur/setup-php@v2"
5662
with:
5763
coverage: "none"
58-
php-version: "8.0"
64+
php-version: "8.2"
5965

6066
- name: "Validate Composer"
6167
run: "composer validate"
6268

6369
- name: "Install dependencies"
6470
run: "composer install --no-interaction --no-progress"
6571

72+
- name: "Install build-cs dependencies"
73+
working-directory: "build-cs"
74+
run: "composer install --no-interaction --no-progress"
75+
6676
- name: "Lint"
6777
run: "make lint"
6878

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/src/GeneratedConfig.php
2+
/build-cs
23
/vendor
34
/composer.lock
45
.phpunit.result.cache

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ lint:
66
php vendor/bin/parallel-lint --colors \
77
src
88

9+
.PHONY: cs-install
10+
cs-install:
11+
git clone https://github.com/phpstan/build-cs.git || true
12+
git -C build-cs fetch origin && git -C build-cs reset --hard origin/main
13+
composer install --working-dir build-cs
14+
915
.PHONY: cs
1016
cs:
11-
composer install --working-dir build-cs && php build-cs/vendor/bin/phpcs
17+
php build-cs/vendor/bin/phpcs --standard=build-cs/phpcs.xml src
1218

1319
.PHONY: cs-fix
1420
cs-fix:
15-
php build-cs/vendor/bin/phpcbf
21+
php build-cs/vendor/bin/phpcbf --standard=build-cs/phpcs.xml src
1622

1723
.PHONY: phpstan
1824
phpstan:

build-cs/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

build-cs/composer.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)