Add php-cs-fixer

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2022-05-20 14:38:35 +02:00
parent cf3ae64e23
commit 95a55cf7b8
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF
5 changed files with 2030 additions and 3 deletions

View file

@ -23,6 +23,22 @@ jobs:
- name: Lint
run: composer run lint
php-cs-fixer:
name: php-cs check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up php
uses: shivammathur/setup-php@2.18.1
with:
php-version: 7.4
coverage: none
- name: Install dependencies
run: composer i
- name: Run coding standards check
run: composer run cs:check
node-linters:
runs-on: ubuntu-latest
name: ESLint

1
.gitignore vendored
View file

@ -7,3 +7,4 @@ js/
richdocuments.zip
build/
vendor/
.php-cs-fixer.cache

19
.php-cs-fixer.dist.php Normal file
View file

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
require_once './vendor/autoload.php';
use Nextcloud\CodingStandard\Config;
$config = new Config();
$config
->getFinder()
// ->ignoreVCSIgnored(true)
->notPath('build')
->notPath('l10n')
->notPath('src')
->notPath('node_modules')
->notPath('vendor')
->in(__DIR__);
return $config;

View file

@ -12,7 +12,9 @@
"roave/security-advisories": "dev-master",
"christophwurst/nextcloud": "dev-master",
"jakub-onderka/php-parallel-lint": "^1.0.0",
"psalm/phar": "^4.7"
"psalm/phar": "^4.7",
"friendsofphp/php-cs-fixer": "^3.8",
"nextcloud/coding-standard": "^1.0"
},
"license": "AGPLv3",
"authors": [
@ -24,6 +26,8 @@
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm.phar",
"psalm:fix": "psalm.phar --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType"
"psalm:fix": "psalm.phar --alter --issues=InvalidReturnType,InvalidNullableReturnType,MismatchingDocblockParamType,MismatchingDocblockReturnType,MissingParamType,InvalidFalsableReturnType",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix"
}
}

1989
composer.lock generated

File diff suppressed because it is too large Load diff