Ajout linter GrumPHP

This commit is contained in:
wpetit 2020-03-09 15:35:19 +01:00
parent dbca54429b
commit 366a82bd9a
5 changed files with 74 additions and 5 deletions

View File

@ -1,16 +1,24 @@
image: node:lts
image: php:7.4-alpine
cache:
paths:
- frontend/node_modules
- backend/vendor
before_script:
- cd frontend && npm install
- cd -
- apk add --no-cache nodejs npm php composer php-mbstring php-iconv php-json php-openssl php-pdo php-xml php-tokenizer php-ctype
- ( cd backend && composer install )
- ( cd frontend && npm install )
stages:
- lint
- test
BackendLint:
stage: lint
script:
- cd backend && ./vendor/bin/grumphp
allow_failure: true
FrontendLint:
stage: lint
@ -21,5 +29,4 @@ FrontendLint:
FrontendTest:
stage: test
script:
- ls -lah
- cd frontend && npm test

View File

@ -18,6 +18,7 @@
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3",
"phpro/grumphp-shim": "^0.18.0",
"symfony/maker-bundle": "^1.14",
"symfony/web-server-bundle": "4.4.*"
},

57
backend/composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b8a24c5421258bb04d461c7dd0498820",
"content-hash": "20f7ea4403b5653bae4a750e7d399e5f",
"packages": [
{
"name": "doctrine/annotations",
@ -4335,6 +4335,61 @@
],
"time": "2019-11-08T13:50:10+00:00"
},
{
"name": "phpro/grumphp-shim",
"version": "v0.18.0",
"source": {
"type": "git",
"url": "https://github.com/phpro/grumphp-shim.git",
"reference": "81a84da47cc825c208b4664857977fbfbf71f0f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpro/grumphp-shim/zipball/81a84da47cc825c208b4664857977fbfbf71f0f6",
"reference": "81a84da47cc825c208b4664857977fbfbf71f0f6",
"shasum": ""
},
"require": {
"composer-plugin-api": "~1.0",
"ext-json": "*",
"php": "^7.1"
},
"replace": {
"phpro/grumphp": "self.version"
},
"require-dev": {
"humbug/box": "^3.8"
},
"bin": [
"grumphp",
"grumphp.phar"
],
"type": "composer-plugin",
"extra": {
"class": "GrumPHP\\Composer\\GrumPHPPlugin"
},
"autoload": {
"psr-4": {
"GrumPHP\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Toon Verwerft",
"email": "toon.verwerft@phpro.be"
},
{
"name": "Community",
"homepage": "https://github.com/phpro/grumphp/graphs/contributors"
}
],
"description": "GrumPHP Phar distribution",
"time": "2020-02-25T18:05:09+00:00"
},
{
"name": "symfony/maker-bundle",
"version": "v1.14.3",

3
backend/grumphp.yml Normal file
View File

@ -0,0 +1,3 @@
parameters:
tasks:
phpstan: ~

View File

@ -126,6 +126,9 @@
"php": {
"version": "7.4"
},
"phpro/grumphp-shim": {
"version": "v0.18.0"
},
"psr/cache": {
"version": "1.0.1"
},