You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library adds a custom report to [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) (phpcs) to generate a codequality artifact, which can be used by Gitlab CI/CD.
9
-
The custom report will be generated in the Code Climate format and allows Gitlab CI/CD to display the violations in the Code Quality report.
8
+
This library adds a custom report to [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/) (phpcs) to generate a codequality artifact that can be used by GitLab CI/CD.
9
+
The custom report is generated in Code Climate format and allows GitLab CI/CD to display the violations in the Code Quality report.
10
10
11
11
## Installation
12
12
@@ -16,7 +16,7 @@ Install this library using [Composer](https://getcomposer.org):
16
16
composer require --dev micheh/phpcs-gitlab
17
17
```
18
18
19
-
Then adjust your `.gitlab-ci.yml` to run PHP_CodeSniffer with the custom reporter and to gather the codequality artifacts:
19
+
Then adjust your `.gitlab-ci.yml` to run PHP_CodeSniffer with the custom reporter and to collect the codequality artifacts:
20
20
21
21
```yaml
22
22
phpcs:
@@ -26,19 +26,25 @@ phpcs:
26
26
codequality: phpcs-quality-report.json
27
27
```
28
28
29
-
The example above uses two reports, one to display in the build log (full) and one to generate the codequality artifact file in the Code Climate format.
29
+
The example above uses two reports, one to display in the build log (full) and one to generate the codequality artifact file in Code Climate format.
30
30
31
-
> **Note:** Gitlab currently does not support multiple codequality artifacts.
32
-
> You will not be able to display the violations of multiple tools (e.g. PHP Code Sniffer & PHPStan) in the Code Quality report.
31
+
> **Note:** GitLab did not support multiple codequality artifacts before version 15.7.
32
+
> If you are using an earlier version of GitLab, you will not be able to see the violations from multiple tools (e.g. PHP Code Sniffer & PHPStan) in the Code Quality report.
33
33
34
-
Inside the codequality artifact, Gitlab expects relative paths to the files with violations.
35
-
To generate relative paths with PHP Code Sniffer, set the `basepath` argument in your `phpcs.xml.dist` configuration file with `<arg name="basepath" value="."/>` or run phpcs with `--basepath=.` (adjust the base path as necessary).
34
+
Inside the codequality artifact, GitLab expects relative paths to the files with violations.
35
+
To generate relative paths with PHP Code Sniffer, set the `basepath` argument in your `phpcs.xml.dist` configuration file with `<arg name="basepath" value="."/>` or run phpcs with `--basepath=.` (adjust the base path as needed).
36
36
37
+
It is also possible to specify the reports to be used in the `phpcs.xml.dist` file:
0 commit comments