1
0
Fork 0
mirror of synced 2024-06-18 18:54:55 +12:00

ci: introduce linter

This commit is contained in:
Torsten Dittmann 2022-05-31 17:09:45 +02:00
parent 15107f0f5c
commit 02bc2f6390
3 changed files with 77 additions and 38 deletions

26
.github/workflows/linter.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: "Linter"
on: [pull_request]
jobs:
tests:
name: Linter
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
- name: Install Dependencies
uses: php-actions/composer@v6
run: composer install --ignore-platform-reqs --no-cache
- name: Run Linter
run: ./vendor/bin/phpcs -p || true

80
composer.lock generated
View file

@ -481,16 +481,16 @@
},
{
"name": "guzzlehttp/guzzle",
"version": "7.4.2",
"version": "7.4.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/guzzle.git",
"reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4"
"reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/ac1ec1cd9b5624694c3a40be801d94137afb12b4",
"reference": "ac1ec1cd9b5624694c3a40be801d94137afb12b4",
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/74a8602c6faec9ef74b7a9391ac82c5e65b1cdab",
"reference": "74a8602c6faec9ef74b7a9391ac82c5e65b1cdab",
"shasum": ""
},
"require": {
@ -585,7 +585,7 @@
],
"support": {
"issues": "https://github.com/guzzle/guzzle/issues",
"source": "https://github.com/guzzle/guzzle/tree/7.4.2"
"source": "https://github.com/guzzle/guzzle/tree/7.4.3"
},
"funding": [
{
@ -601,7 +601,7 @@
"type": "tidelift"
}
],
"time": "2022-03-20T14:16:28+00:00"
"time": "2022-05-25T13:24:33+00:00"
},
{
"name": "guzzlehttp/promises",
@ -1639,25 +1639,25 @@
},
{
"name": "symfony/deprecation-contracts",
"version": "v3.0.1",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c"
"reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
"reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
"reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918",
"shasum": ""
},
"require": {
"php": ">=8.0.2"
"php": ">=8.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -1686,7 +1686,7 @@
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.1"
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0"
},
"funding": [
{
@ -1702,7 +1702,7 @@
"type": "tidelift"
}
],
"time": "2022-01-02T09:55:41+00:00"
"time": "2022-02-25T11:15:52+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -5767,20 +5767,21 @@
},
{
"name": "symfony/console",
"version": "v6.0.8",
"version": "v6.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "0d00aa289215353aa8746a31d101f8e60826285c"
"reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/0d00aa289215353aa8746a31d101f8e60826285c",
"reference": "0d00aa289215353aa8746a31d101f8e60826285c",
"url": "https://api.github.com/repos/symfony/console/zipball/c9646197ef43b0e2ff44af61e7f0571526fd4170",
"reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"symfony/deprecation-contracts": "^2.1|^3",
"symfony/polyfill-mbstring": "~1.0",
"symfony/service-contracts": "^1.1|^2|^3",
"symfony/string": "^5.4|^6.0"
@ -5842,7 +5843,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v6.0.8"
"source": "https://github.com/symfony/console/tree/v6.1.0"
},
"funding": [
{
@ -5858,7 +5859,7 @@
"type": "tidelift"
}
],
"time": "2022-04-20T15:01:42+00:00"
"time": "2022-05-27T06:34:22+00:00"
},
{
"name": "symfony/polyfill-intl-grapheme",
@ -6110,20 +6111,20 @@
},
{
"name": "symfony/service-contracts",
"version": "v3.0.1",
"version": "v3.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/service-contracts.git",
"reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c"
"reference": "d66cd8ab656780f62c4215b903a420eb86358957"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/e517458f278c2131ca9f262f8fbaf01410f2c65c",
"reference": "e517458f278c2131ca9f262f8fbaf01410f2c65c",
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957",
"reference": "d66cd8ab656780f62c4215b903a420eb86358957",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"psr/container": "^2.0"
},
"conflict": {
@ -6135,7 +6136,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "3.0-dev"
"dev-main": "3.1-dev"
},
"thanks": {
"name": "symfony/contracts",
@ -6145,7 +6146,10 @@
"autoload": {
"psr-4": {
"Symfony\\Contracts\\Service\\": ""
}
},
"exclude-from-classmap": [
"/Test/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
@ -6172,7 +6176,7 @@
"standards"
],
"support": {
"source": "https://github.com/symfony/service-contracts/tree/v3.0.1"
"source": "https://github.com/symfony/service-contracts/tree/v3.1.0"
},
"funding": [
{
@ -6188,24 +6192,24 @@
"type": "tidelift"
}
],
"time": "2022-03-13T20:10:05+00:00"
"time": "2022-05-07T08:07:09+00:00"
},
{
"name": "symfony/string",
"version": "v6.0.8",
"version": "v6.1.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d"
"reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/ac0aa5c2282e0de624c175b68d13f2c8f2e2649d",
"reference": "ac0aa5c2282e0de624c175b68d13f2c8f2e2649d",
"url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529",
"reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529",
"shasum": ""
},
"require": {
"php": ">=8.0.2",
"php": ">=8.1",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
@ -6257,7 +6261,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v6.0.8"
"source": "https://github.com/symfony/string/tree/v6.1.0"
},
"funding": [
{
@ -6273,7 +6277,7 @@
"type": "tidelift"
}
],
"time": "2022-04-22T08:18:02+00:00"
"time": "2022-04-22T08:18:23+00:00"
},
{
"name": "textalk/websocket",
@ -6632,5 +6636,5 @@
"platform-overrides": {
"php": "8.0"
},
"plugin-api-version": "2.2.0"
"plugin-api-version": "2.3.0"
}

9
phpcs.xml Normal file
View file

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<ruleset name="Custom Standard" namespace="MyProject\CS\Standard">
<description>A custom coding standard</description>
<file>./app</file>
<file>./src</file>
<file>./tests</file>
<ini name="memory_limit" value="512M"/>
<rule ref="PSR12"/>
</ruleset>