Skip to content

Commit ecfd995

Browse files
committed
Use phpstan/build-cs
1 parent 5e07ada commit ecfd995

17 files changed

+45
-459
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ jobs:
7070
- name: "Checkout"
7171
uses: actions/checkout@v4
7272

73+
- name: "Checkout build-cs"
74+
uses: actions/checkout@v4
75+
with:
76+
repository: "phpstan/build-cs"
77+
path: "build-cs"
78+
ref: "2.x"
79+
7380
- name: "Install PHP"
7481
uses: "shivammathur/setup-php@v2"
7582
with:
@@ -82,6 +89,10 @@ jobs:
8289
- name: "Install dependencies"
8390
run: "composer install --no-interaction --no-progress"
8491

92+
- name: "Install build-cs dependencies"
93+
working-directory: "build-cs"
94+
run: "composer install --no-interaction --no-progress"
95+
8596
- name: "Lint"
8697
run: "make lint"
8798

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/compiler/tmp
33
/compiler/vendor
44
/conf/config.local.yml
5+
/build-cs
56
/vendor
67
/.idea/*
78
!.idea/icon.png

Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,18 @@ lint:
115115
install-paratest:
116116
composer install --working-dir tests
117117

118-
cs:
119-
composer install --working-dir build-cs && XDEBUG_MODE=off php build-cs/vendor/bin/phpcs
120-
121-
cs-fix:
118+
.PHONY: cs-install
119+
cs-install:
120+
git clone https://github.com/phpstan/build-cs.git || true
121+
git -C build-cs fetch origin && git -C build-cs reset --hard origin/2.x
122+
composer install --working-dir build-cs
123+
124+
.PHONY: cs
125+
cs: cs-install
126+
XDEBUG_MODE=off php build-cs/vendor/bin/phpcs
127+
128+
.PHONY: cs-fix
129+
cs-fix: cs-install
122130
XDEBUG_MODE=off php build-cs/vendor/bin/phpcbf
123131

124132
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)