Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aa4e98e

Browse files
Next-gen coding standard workflow
1 parent 2003479 commit aa4e98e

File tree

7 files changed

+21
-466
lines changed

7 files changed

+21
-466
lines changed

‎.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: "Lint"
4949
run: "make lint"
5050

51-
coding-standards:
51+
coding-standard:
5252
name: "Coding Standard"
5353

5454
runs-on: "ubuntu-latest"
@@ -57,11 +57,17 @@ jobs:
5757
- name: "Checkout"
5858
uses: actions/checkout@v3
5959

60+
- name: "Checkout build-cs"
61+
uses: actions/checkout@v3
62+
with:
63+
repository: "phpstan/build-cs"
64+
path: "build-cs"
65+
6066
- name: "Install PHP"
6167
uses: "shivammathur/setup-php@v2"
6268
with:
6369
coverage: "none"
64-
php-version: "8.0"
70+
php-version: "8.2"
6571
ini-file: development
6672

6773
- name: "Validate Composer"
@@ -70,6 +76,10 @@ jobs:
7076
- name: "Install dependencies"
7177
run: "composer install --no-interaction --no-progress"
7278

79+
- name: "Install build-cs dependencies"
80+
working-directory: "build-cs"
81+
run: "composer install --no-interaction --no-progress"
82+
7383
- name: "Lint"
7484
run: "make lint"
7585

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/tests/tmp
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
@@ -11,13 +11,19 @@ lint:
1111
--exclude tests/Rules/DeadCode/data/bug-383.php \
1212
src tests
1313

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

1824
.PHONY: cs-fix
1925
cs-fix:
20-
php build-cs/vendor/bin/phpcbf
26+
php build-cs/vendor/bin/phpcbf --standard=build-cs/phpcs.xml src tests
2127

2228
.PHONY: phpstan
2329
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)

AltStyle によって変換されたページ (->オリジナル) /