From 4797963ea540ead8fc48f2e9e3bc735e9a3c6938 Mon Sep 17 00:00:00 2001 From: quiqqer-stabilization-gitlab-repository-manager <server+quiqqer-stabilization-gitlab-repository-manager@pcsg.de> Date: Thu, 12 Dec 2024 16:39:24 +0000 Subject: [PATCH] chore: setup PHP_CodeSniffer for project tooling --- .phive/phars.xml | 2 ++ phpcs.xml.dist | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 phpcs.xml.dist diff --git a/.phive/phars.xml b/.phive/phars.xml index 2abf1f9..5950dfc 100644 --- a/.phive/phars.xml +++ b/.phive/phars.xml @@ -2,4 +2,6 @@ <phive xmlns="https://phar.io/phive"> <phar name="phpstan" version="1.10.60" installed="1.10.60" location="./tools/phpstan" copy="false"/> <phar name="phpunit" version="^10.5.16" installed="10.5.16" location="./tools/phpunit" copy="false"/> + <phar name="phpcs" version="^3.10.2" installed="3.10.2" location="./tools/phpcs" copy="false"/> + <phar name="phpcbf" version="^3.10.2" installed="3.10.2" location="./tools/phpcbf" copy="false"/> </phive> diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..d48084f --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<ruleset> + <!-- Use PSR-12 ruleset --> + <rule ref="PSR12"/> + + <!-- Only scan *.php files --> + <arg name="extensions" value="php"/> + + <!-- Ignore warnings --> + <arg name="warning-severity" value="0"/> + + <!-- Process 64 (or number of CPU cores) files in parallel --> + <arg name="parallel" value="64"/> + + <!-- Output relative file paths, by setting the current folder as the basepath --> + <arg name="basepath" value="."/> + + <!-- Show colored output --> + <arg name="colors"/> + + <!-- Scan everything in the current folder --> + <file>.</file> +</ruleset> -- GitLab