Skip to content

Commit 33195a6

Browse files
committed
Next-gen coding standard workflow
1 parent 7f78fd1 commit 33195a6

File tree

9 files changed

+21
-468
lines changed

9 files changed

+21
-468
lines changed

.gitattributes

-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@ tmp export-ignore
1313
build-abnfgen.sh export-ignore
1414
CODE_OF_CONDUCT.md export-ignore
1515
Makefile export-ignore
16-
phpcs.xml export-ignore
1716
phpstan.neon export-ignore
1817
phpunit.xml export-ignore

.github/renovate.json

-5
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
"enabled": true,
1111
"groupName": "root-composer"
1212
},
13-
{
14-
"matchPaths": ["build-cs/**"],
15-
"enabled": true,
16-
"groupName": "build-cs"
17-
},
1813
{
1914
"matchPaths": [".github/**"],
2015
"enabled": true,

.github/workflows/build.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: "Lint"
4747
run: "make lint"
4848

49-
coding-standards:
49+
coding-standard:
5050
name: "Coding Standard"
5151

5252
runs-on: "ubuntu-latest"
@@ -55,18 +55,28 @@ jobs:
5555
- name: "Checkout"
5656
uses: actions/checkout@v3
5757

58+
- name: "Checkout build-cs"
59+
uses: actions/checkout@v3
60+
with:
61+
repository: "phpstan/build-cs"
62+
path: "build-cs"
63+
5864
- name: "Install PHP"
5965
uses: "shivammathur/setup-php@v2"
6066
with:
6167
coverage: "none"
62-
php-version: "8.0"
68+
php-version: "8.2"
6369

6470
- name: "Validate Composer"
6571
run: "composer validate"
6672

6773
- name: "Install dependencies"
6874
run: "composer install --no-interaction --no-progress"
6975

76+
- name: "Install build-cs dependencies"
77+
working-directory: "build-cs"
78+
run: "composer install --no-interaction --no-progress"
79+
7080
- name: "Lint"
7181
run: "make lint"
7282

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/temp
33
/tools
44
/tests/tmp
5+
/build-cs
56
/vendor
67
/composer.lock
78
.phpunit.result.cache

Makefile

+8-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,19 @@ lint:
1313
--exclude tests/PHPStan/Rules/Methods/data \
1414
--exclude tests/PHPStan/Rules/Functions/data
1515

16+
.PHONY: cs-install
17+
cs-install:
18+
git clone https://github.com/phpstan/build-cs.git || true
19+
git -C build-cs fetch origin && git -C build-cs reset --hard origin/main
20+
composer install --working-dir build-cs
21+
1622
.PHONY: cs
1723
cs:
18-
composer install --working-dir build-cs && php build-cs/vendor/bin/phpcs
24+
php build-cs/vendor/bin/phpcs --standard=build-cs/phpcs.xml src tests
1925

2026
.PHONY: cs-fix
2127
cs-fix:
22-
php build-cs/vendor/bin/phpcbf
28+
php build-cs/vendor/bin/phpcbf --standard=build-cs/phpcs.xml src tests
2329

2430
.PHONY: phpstan
2531
phpstan:

build-cs/.gitignore

-1
This file was deleted.

build-cs/composer.json

-13
This file was deleted.

0 commit comments

Comments
 (0)