Use Standard Nextcloud Coding Style for PHP

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
Georg Ehrke 2020-04-15 13:05:53 +02:00
parent 9680032c55
commit 99ebda920f
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
5 changed files with 3400 additions and 1 deletions

View File

@ -52,3 +52,19 @@ jobs:
run: npm run lint
env:
CI: true
php-cs-fixer:
name: php-cs check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php
uses: shivammathur/setup-php@master
with:
php-version: 7.4
coverage: none
- name: Install dependencies
run: composer i
- name: Run coding standards check
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

1
.gitignore vendored
View File

@ -92,6 +92,7 @@ CVS/*
RCS/*
/.project
.php_cs.cache
coverage/

16
.php_cs.dist Normal file
View File

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

View File

@ -5,7 +5,8 @@
}
},
"require": {
"php": ">=7.2"
"php": ">=7.2",
"nextcloud/coding-standard": "^0.3.0"
},
"require-dev": {
"christophwurst/nextcloud": "v18.0.2",
@ -13,6 +14,8 @@
"phan/phan": "^2.0"
},
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run",
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;",
"phan": "phan --allow-polyfill-parser -k .phan/config.php",
"test": "phpunit --configuration phpunit.unit.xml --fail-on-warning"

3363
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff