Add php cs

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2020-07-09 17:21:34 +02:00
parent 01418849f3
commit 73823f4507
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
5 changed files with 1694 additions and 4 deletions

View File

@ -28,6 +28,30 @@ jobs:
- name: Lint
run: composer run lint
php-cs-fixer:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4']
name: cs php${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
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 )
node:
runs-on: ubuntu-latest
@ -35,7 +59,7 @@ jobs:
matrix:
node-versions: [12.x]
name: node${{ matrix.node-versions }}
name: eslint node${{ matrix.node-versions }}
steps:
- uses: actions/checkout@v2
@ -49,3 +73,25 @@ jobs:
- name: Lint
run: npm run lint
stylelint:
runs-on: ubuntu-latest
strategy:
matrix:
node-versions: [12.x]
name: stylelint node${{ matrix.node-versions }}
steps:
- uses: actions/checkout@v2
- name: Set up node ${{ matrix.node-versions }}
uses: actions/setup-node@v1
with:
node-versions: ${{ matrix.node-versions }}
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run stylelint

2
.gitignore vendored
View File

@ -18,3 +18,5 @@ js/
build/
coverage*
vendor/
/.php_cs.cache

17
.php_cs.dist Normal file
View File

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

View File

@ -1,12 +1,15 @@
{
"require-dev": {
"christophwurst/nextcloud_testing": "^0.7.0"
"christophwurst/nextcloud_testing": "^0.7.0",
"nextcloud/coding-standard": "^0.3.0"
},
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"scripts": {
"cs:fix": "php-cs-fixer fix",
"cs:check": "php-cs-fixer fix --dry-run --diff",
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
"test:unit": "phpunit -c phpunit.xml --fail-on-warning",
"test:integration": "phpunit -c phpunit.integration.xml --fail-on-warning"

1626
composer.lock generated

File diff suppressed because it is too large Load Diff