Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add php-cs-fixer #677

Merged
merged 2 commits into from Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Expand Up @@ -21,6 +21,21 @@ jobs:
run: |
cd tasmoadmin
./vendor/bin/phpstan
php-cs-fixer:
name: Run PHPStan
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@master
with:
php-version: '8.1'
- name: Install dependencies
run: composer install -d tasmoadmin/
- name: Run php-cs-fixer
run: |
cd tasmoadmin
./vendor/bin/php-cs-fixer fix --dry-run
php-tests:
name: Run PHP tests
runs-on: ubuntu-20.04
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,6 +29,7 @@
/tasmoadmin/vendor/
.phpunit.result.cache
/tasmoadmin/coverage.xml
.php-cs-fixer.cache

!.empty
!.htaccess
Expand Down
20 changes: 20 additions & 0 deletions tasmoadmin/.php-cs-fixer.dist.php
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

$finder = PhpCsFixer\Finder::create()
->in(['src', 'tests'])
;

$config = new PhpCsFixer\Config();

$config
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@PSR12' => true,
])
->setFinder($finder)
;

return $config;
3 changes: 2 additions & 1 deletion tasmoadmin/composer.json
Expand Up @@ -24,7 +24,8 @@
"require-dev": {
"phpunit/phpunit": "^9.3.8",
"mikey179/vfsstream": "^1.6",
"phpstan/phpstan": "^1.6"
"phpstan/phpstan": "^1.6",
"friendsofphp/php-cs-fixer": "^3.11"
},
"autoload-dev": {
"psr-4": {
Expand Down