-
Notifications
You must be signed in to change notification settings - Fork 6
How to install and setup PHPLint
Tom de Wit edited this page Dec 11, 2020
·
3 revisions
https://github.com/overtrue/phplint
composer require overtrue/phplint --dev
./vendor/bin/phplint ./ --exclude=vendor --no-cache --json=phplint.json
We run PHPLint in the root folder of the project but we exclude the vendor
folder. We output the result to a JSON-file called phplint.json
.
PHPLint:
stage: Code quality
allow_failure: true
script:
- ./vendor/bin/phplint ./ --exclude=vendor --no-cache --json=phplint.json
artifacts:
paths:
- phplint.json
when: always
Earlier in the configuration file you've defined the "Code quality" stage. Since quality assurance tools can fail we allow this job to fail to signal there are PHPLint errors. We then run the aforementioned script and save the output. Since GitLab, by default, doesn't store it's artifacts on failure, we overrule it's setting by always uploading phplint.json
.