From 366a82bd9af9e042744f258c919255bfa44d32ec Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 9 Mar 2020 15:35:19 +0100 Subject: [PATCH] Ajout linter GrumPHP --- .gitlab-ci.yml | 15 +++++++++--- backend/composer.json | 1 + backend/composer.lock | 57 ++++++++++++++++++++++++++++++++++++++++++- backend/grumphp.yml | 3 +++ backend/symfony.lock | 3 +++ 5 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 backend/grumphp.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index abd238f..2baf851 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/backend/composer.json b/backend/composer.json index 5d6f65b..f2bdb8f 100644 --- a/backend/composer.json +++ b/backend/composer.json @@ -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.*" }, diff --git a/backend/composer.lock b/backend/composer.lock index a311122..73d177c 100644 --- a/backend/composer.lock +++ b/backend/composer.lock @@ -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", diff --git a/backend/grumphp.yml b/backend/grumphp.yml new file mode 100644 index 0000000..b94243f --- /dev/null +++ b/backend/grumphp.yml @@ -0,0 +1,3 @@ +parameters: + tasks: + phpstan: ~ diff --git a/backend/symfony.lock b/backend/symfony.lock index aeacb52..8488fa9 100644 --- a/backend/symfony.lock +++ b/backend/symfony.lock @@ -126,6 +126,9 @@ "php": { "version": "7.4" }, + "phpro/grumphp-shim": { + "version": "v0.18.0" + }, "psr/cache": { "version": "1.0.1" },