Download the PHP package maximal/gitlab-code-quality without Composer
On this page you can find all versions of the php package maximal/gitlab-code-quality. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download maximal/gitlab-code-quality
More information about maximal/gitlab-code-quality
Files in maximal/gitlab-code-quality
Package gitlab-code-quality
Short Description GitLab Code Quality generator for PHP and JS projects
License MIT
Informations about the package gitlab-code-quality
GitLab Code Quality generator for PHP and JS projects
This program generates Code Climate report for GitLab Code Quality widget in merge requests and pipelines using various tools and linters:
They are automatically detected in the following paths:
vendor/bin/psalm
vendor/bin/phpstan
vendor/bin/phpcs
vendor/bin/ecs
node_modules/eslint/bin/eslint.js
node_modules/stylelint/bin/stylelint.mjs
node_modules/@biomejs/biome/bin/biome
Two JS runtimes supported (to run Biome, ESLint, and StyleLint checks):
The application is written in pure PHP (8.0+) without any framework or library dependencies.
Installation
Install the tool via Composer:
Make the test run:
Now, you should have gl-code-quality-report.json
file with all code quality issues found in your project.
Usage
Edit your GitLab CI/CD config to have code_quality
step, which runs this tool.
Example .gitlab-ci.yml
file:
Strict Mode
By default, the tool returns non-zero exit code (1) only if critical errors are found. For example, on PHP syntax parsing errors (the code cannot be executed at all). This is considered a non-strict behavior.
Although, you can harden issue handling and have non-zero exit code (2) if any issues are found:
In strict mode, code quality stage will fail CI/CD pipeline even on minor issues.
Configuration
Code quality tools are detected automatically and run with their default config files.
You can override this behavior in extra
section of your project’s composer.json
file:
In most cases you only need to specify php-dir
and js-dir
paths. For example:
In an ordinary Laravel project this tool runs in zero-config way with Laravel’s default paths (php-dir
is .
and js-dir
is resourses
):
Coding Style
PER-2T / PSR-12T (PHP’s standard PER-2 / PSR-12 with SmartTabs instead of spaces).
Author
All versions of gitlab-code-quality with dependencies
ext-json Version *
ext-mbstring Version *
ext-simplexml Version *