Skip to content

Commit

Permalink
Revert "Next-gen coding standard workflow"
Browse files Browse the repository at this point in the history
This reverts commit 4255c03.
  • Loading branch information
ondrejmirtes committed May 25, 2023
1 parent 4255c03 commit cf5912d
Show file tree
Hide file tree
Showing 9 changed files with 464 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ tmp export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Makefile export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
"enabled": true,
"groupName": "root-composer"
},
{
"matchPaths": ["build-cs/**"],
"enabled": true,
"groupName": "build-cs"
},
{
"matchPaths": [".github/**"],
"enabled": true,
Expand Down
14 changes: 2 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: "Lint"
run: "make lint"

coding-standard:
coding-standards:
name: "Coding Standard"

runs-on: "ubuntu-latest"
Expand All @@ -51,28 +51,18 @@ jobs:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Checkout build-cs"
uses: actions/checkout@v3
with:
repository: "phpstan/build-cs"
path: "build-cs"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.2"
php-version: "8.0"

- name: "Validate Composer"
run: "composer validate"

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

- name: "Install build-cs dependencies"
working-directory: "build-cs"
run: "composer install --no-interaction --no-progress"

- name: "Lint"
run: "make lint"

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/src/GeneratedConfig.php
/build-cs
/vendor
/composer.lock
.phpunit.result.cache
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,13 @@ lint:
php vendor/bin/parallel-lint --colors \
src

.PHONY: cs-install
cs-install:
git clone https://github.com/phpstan/build-cs.git || true
git -C build-cs fetch origin && git -C build-cs reset --hard origin/main
composer install --working-dir build-cs

.PHONY: cs
cs:
php build-cs/vendor/bin/phpcs --standard=build-cs/phpcs.xml src
composer install --working-dir build-cs && php build-cs/vendor/bin/phpcs

.PHONY: cs-fix
cs-fix:
php build-cs/vendor/bin/phpcbf --standard=build-cs/phpcs.xml src
php build-cs/vendor/bin/phpcbf

.PHONY: phpstan
phpstan:
Expand Down
1 change: 1 addition & 0 deletions build-cs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor
13 changes: 13 additions & 0 deletions build-cs/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"require-dev": {
"consistence-community/coding-standard": "^3.11.0",
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"slevomat/coding-standard": "^8.8.0",
"squizlabs/php_codesniffer": "^3.5.3"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit cf5912d

Please sign in to comment.