Add php-cs-fixer configuration

Signed-off-by: Raimund Schlüßler <raimund.schluessler@mailbox.org>
This commit is contained in:
Raimund Schlüßler 2020-04-10 13:18:30 +02:00
parent 80a3133cf5
commit e8213d582c
5 changed files with 3054 additions and 21 deletions

6
.gitignore vendored
View File

@ -1,3 +1,7 @@
# Composer
composer.phar
/vendor/
######################
## Files build by make
######################
@ -249,3 +253,5 @@ Various
build/
coverage
.phpunit.result.cache
.php_cs.cache

19
.php_cs.dist 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)
->exclude('config')
->exclude('data')
->notPath('3rdparty')
->notPath('composer')
->notPath('vendor')
->in(__DIR__);
return $config;

View File

@ -87,6 +87,16 @@ watch-js:
build-svg-sprite:
npm run svg_sprite
composer.phar:
curl -sS https://getcomposer.org/installer | php
install-composer-deps-dev: composer.phar
php composer.phar install -o
update-composer: composer.phar
rm -f composer.lock
php composer.phar install --prefer-dist
# Removes the build directory and the compiled files
.PHONY: clean
clean:
@ -182,3 +192,6 @@ test-php:
test-php-coverage:
phpunit -c phpunit.xml --coverage-clover=coverage-unit.xml
phpunit -c phpunit.integration.xml --coverage-clover=coverage-integration.xml
lint-php:
php composer.phar run-script cs:check

View File

@ -1,23 +1,26 @@
{
"name": "nextcloud/tasks",
"description": "Nextcloud Tasks",
"type": "project",
"license": "AGPL",
"authors": [
{
"name": "Bernhard Posselt",
"email": "dev@bernhard-posselt.com"
}
],
"require": {},
"require-dev": {
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;"
}
"name": "nextcloud/tasks",
"description": "Nextcloud Tasks",
"type": "project",
"license": "AGPL",
"authors": [
{
"name": "Bernhard Posselt",
"email": "dev@bernhard-posselt.com"
}
],
"require": {},
"require-dev": {
"nextcloud/coding-standard": "^0.2.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --verbose",
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;"
}
}

2992
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff