From f2852e18b2e75f79cb8b20baf3837a40128aa5ec Mon Sep 17 00:00:00 2001 From: lganee <ludovic.ganee@libriciel.coop> Date: Tue, 5 Sep 2023 16:29:53 +0200 Subject: [PATCH] ajout du asalae_old_coding_standards.xml --- .gitlab-ci.yml | 2 +- asalae_old_coding_standards.xml | 77 +++++++++++++++++++++++++++++++++ composer.lock | 32 +++++++------- 3 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 asalae_old_coding_standards.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 671c06a07..431ceacfa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,5 +61,5 @@ code-style: - date +"%T" - if [ ! -f vendor/phpunit/phpunit/phpunit ]; then composer install; fi - composer dump-autoload - - vendor/squizlabs/php_codesniffer/bin/phpcs --colors -p --runtime-set ignore_warnings_on_exit true --standard=asalae_coding_standards.xml ./src + - vendor/squizlabs/php_codesniffer/bin/phpcs --colors -p --runtime-set ignore_warnings_on_exit true --standard=asalae_old_coding_standards.xml ./src - date +"%T" diff --git a/asalae_old_coding_standards.xml b/asalae_old_coding_standards.xml new file mode 100644 index 000000000..44501920f --- /dev/null +++ b/asalae_old_coding_standards.xml @@ -0,0 +1,77 @@ +<?xml version="1.0"?> +<ruleset name="Asalae"> + <description>Asalae coding standard</description> + + <rule ref="PSR2"/> + <rule ref="Generic.Arrays.ArrayIndent"/> + <rule ref="PEAR.Classes"/> + <rule ref="PEAR.Commenting.FunctionComment"/> + <rule ref="PEAR.Commenting.FunctionComment.MissingParamTag"/> + <!-- pas besoin de commentaire sur chaques paramètres de fonction --> + <rule ref="PEAR.Commenting.FunctionComment.MissingParamComment"> + <severity>0</severity> + </rule> + <rule ref="PEAR.Commenting.FunctionComment.ContentAfterOpen"/> + <rule ref="PEAR.Commenting.FunctionComment.ContentBeforeClose"/> + <rule ref="PEAR.ControlStructures"/> + <rule ref="PEAR.Files"/> + <rule ref="PEAR.Formatting"/> + <rule ref="PEAR.Functions"/> + <rule ref="PEAR.Functions.FunctionCallSignature"/> + + <!-- espacement des arguments de fonction --> + <rule ref="Generic.Functions.FunctionCallArgumentSpacing"/> + <!-- les constantes doivent être complètement en majuscules --> + <rule ref="Generic.NamingConventions.UpperCaseConstantName"/> + <rule ref="Generic.PHP.LowerCaseConstant"/> + <!-- "<?php" oui, "<?" non --> + <rule ref="Generic.PHP.DisallowShortOpenTag"/> + <!-- indentation avec des espaces (pas de tabulation) --> + <rule ref="Generic.WhiteSpace.DisallowTabIndent"/> + <!-- phpdoc bien aligné --> + <rule ref="Squiz.Commenting.DocCommentAlignment"/> + <!-- retour à la ligne en fin de document --> + <rule ref="Generic.Files.LineEndings"> + <properties> + <property name="eolChar" value="\n"/> + </properties> + </rule> + <!-- interdit plus de 1 espace après une virgule --> + <rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma"> + <severity>0</severity> + </rule> + <!-- interdit les if sans accolades --> + <rule ref="Generic.ControlStructures.InlineControlStructure"> + <properties> + <property name="error" value="false"/> + </properties> + </rule> + <!-- interdit les fonctions trop complexes --> + <rule ref="Generic.Metrics.CyclomaticComplexity"> + <properties> + <property name="complexity" value="20"/> + <property name="absoluteComplexity" value="30"/> + </properties> + </rule> + <!-- interdit une profondeur trop élevée ex: else { if() { foreach () { try() { if() --> + <rule ref="Generic.Metrics.NestingLevel"> + <properties> + <property name="nestingLevel" value="4"/> + <property name="absoluteNestingLevel" value="5"/> + </properties> + </rule> + + <!-- Autorise les préfixes "_" pour les fonctions et propriétés protected/private (convention cakephp) --> + <rule ref="PSR2.Classes.PropertyDeclaration.Underscore"> + <severity>0</severity> + </rule> + <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> + <severity>0</severity> + </rule> + <rule ref="PEAR.NamingConventions.ValidFunctionName.PublicUnderscore"> + <severity>0</severity> + </rule> + <rule ref="PEAR.Commenting.FunctionComment.MissingReturn"> + <severity>0</severity> + </rule> +</ruleset> diff --git a/composer.lock b/composer.lock index a872d472c..29c5c39c7 100644 --- a/composer.lock +++ b/composer.lock @@ -127,16 +127,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.279.3", + "version": "3.279.5", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "13e0142365a1f07cedab01dbbda605dff8b7832f" + "reference": "5cd1276c49effad408928e19a44a7d188cb9dedf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/13e0142365a1f07cedab01dbbda605dff8b7832f", - "reference": "13e0142365a1f07cedab01dbbda605dff8b7832f", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5cd1276c49effad408928e19a44a7d188cb9dedf", + "reference": "5cd1276c49effad408928e19a44a7d188cb9dedf", "shasum": "" }, "require": { @@ -216,9 +216,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.279.3" + "source": "https://github.com/aws/aws-sdk-php/tree/3.279.5" }, - "time": "2023-08-21T18:04:10+00:00" + "time": "2023-08-23T18:34:06+00:00" }, { "name": "cakephp/acl", @@ -7386,32 +7386,32 @@ }, { "name": "phrity/net-uri", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sirn-se/phrity-net-uri.git", - "reference": "c6ecf127e7c99a41ce04d3cdcda7f51108dd96f7" + "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/c6ecf127e7c99a41ce04d3cdcda7f51108dd96f7", - "reference": "c6ecf127e7c99a41ce04d3cdcda7f51108dd96f7", + "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/3f458e0c4d1ddc0e218d7a5b9420127c63925f43", + "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43", "shasum": "" }, "require": { - "php": "^7.4|^8.0", + "php": "^7.4 | ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 | ^2.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.0", - "phpunit/phpunit": "^9.0", + "phpunit/phpunit": "^9.0 | ^10.0", "squizlabs/php_codesniffer": "^3.0" }, "type": "library", "autoload": { "psr-4": { - "": "src/" + "Phrity\\Net\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -7435,9 +7435,9 @@ ], "support": { "issues": "https://github.com/sirn-se/phrity-net-uri/issues", - "source": "https://github.com/sirn-se/phrity-net-uri/tree/1.2.0" + "source": "https://github.com/sirn-se/phrity-net-uri/tree/1.3.0" }, - "time": "2022-11-30T07:20:06+00:00" + "time": "2023-08-21T10:33:06+00:00" }, { "name": "phrity/util-errorhandler", -- GitLab