Commit 69f6727a authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Configuration gitlab, phpcs, phpmd et php-cs-fixer.

Showing with 114 additions and 18 deletions
+114 -18
......@@ -2,4 +2,6 @@
/components/
/composer.lock
/apigen
/nbproject/private/
\ No newline at end of file
/nbproject
/.php_cs.cache
/.idea
cache:
key: "$CI_COMMIT_REF_NAME-$CI_JOB_NAME"
paths:
- $HOME/.composer/cache
- vendor/
variables:
COMPOSER_NO_INTERACTION: "1"
COMPOSER_ALLOW_SUPERUSER: "1"
S6_TARGET: none
DEBIAN_FRONTEND: noninteractive
phpunit:
stage: test
tags: [docker]
image: isdevtools.irstea.fr/poleis/php-apache2:stretch-7.1
before_script:
- phpenmod pdo_sqlite curl
- composer update --prefer-dist --no-progress --ansi --no-suggest --prefer-stable
script:
- vendor/bin/phpunit
.static-analysis: &static-analysis
stage: test
tags: [docker]
image: isdevtools.irstea.fr/poleis/php-analysis:7.1
phploc:
<<: *static-analysis
script:
- phploc --exclude=vendor .
lint:
<<: *static-analysis
script:
- parallel-lint -j $(nproc) --exclude vendor .
phpcs:
<<: *static-analysis
script:
- phpcs --colors --parallel=$(nproc) .
allow_failure: true
phpcpd:
<<: *static-analysis
script:
- phpcpd --exclude=vendor --fuzzy .
phpmd:
<<: *static-analysis
script:
- phpmd . text ./phpmd.xml --suffixes=php
allow_failure: true
satis:
stage: deploy
tags: [shell]
image: alpine
variables:
GIT_STRATEGY: none
before_script:
- apk update && apk add curl
script:
- curl -sS "https://isdevtools.irstea.fr/satis/trigger.php?package=irstea/$CI_PROJECT_NAME"
/home/guillaume.perreal/.config/devtools/php/.php_cs.dist
\ No newline at end of file
<?xml version="1.0"?>
<ruleset name="Irstea" namespace="Irstea\Standard">
<description>Coding standard of Irstea, pôle informatique scientifique</description>
<file>src</file>
<arg name="encoding" value="utf-8"/>
<arg value="sp"/>
<rule ref="PSR2"/>
<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="140"/>
</properties>
</rule>
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>cache/</exclude-pattern>
</ruleset>
<?xml version="1.0"?>
<ruleset name="SYGADE PHPMD rule set"
<ruleset name="Irstea PHPMD ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd">
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
<rule ref="rulesets/codesize.xml/ExcessiveClassLength" />
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
<description>Irstea ruleset</description>
<rule ref="rulesets/controversial.xml" />
<rule ref="rulesets/unusedcode.xml" />
<rule ref="rulesets/unusedcode.xml"/>
<rule ref="rulesets/codesize.xml"/>
<rule ref="rulesets/design.xml"/>
<rule ref="rulesets/controversial.xml"/>
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/GotoStatement" />
<rule ref="rulesets/cleancode.xml/StaticAccess">
<properties>
<property name="exceptions" value="\DateTime,\DateTimeZone,\Doctrine\DBAL\Types\ConversionException"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
</rule>
<rule ref="rulesets/naming.xml/ShortVariable">
<properties>
<property name="exceptions" value="id,em" />
<property name="exceptions" value="em,tz,i,j,id,x,y,dn,fh,ex"/>
</properties>
</rule>
<rule ref="rulesets/naming.xml/LongVariable" />
<rule ref="rulesets/naming.xml/ShortMethodName" />
<rule ref="rulesets/naming.xml/ConstructorWithNameAsEnclosingClass" />
<rule ref="rulesets/naming.xml/ConstantNamingConventions" />
<rule ref="rulesets/naming.xml/BooleanGetMethodName" />
<exclude-pattern>vendor/</exclude-pattern>
<exclude-pattern>node_modules/</exclude-pattern>
<exclude-pattern>.*/cache/</exclude-pattern>
</ruleset>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment