feat: customize linters per contributor

- phpstan.dist.neon (shared options) -> phpstan.neon (local options)
- phpunit.xml.dist (shared options) -> phpunit.xml (local options)
pull/682/head
fadrian06 3 days ago
parent 690918a014
commit 9ef15cf5dc

6
.gitattributes vendored

@ -4,10 +4,10 @@
/.editorconfig export-ignore /.editorconfig export-ignore
/.gitattributes export-ignore /.gitattributes export-ignore
/.gitignore export-ignore /.gitignore export-ignore
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/CONTRIBUTING.md export-ignore /CONTRIBUTING.md export-ignore
/index.php export-ignore /index.php export-ignore
/phpcs.xml.dist export-ignore
/phpstan-baseline.neon export-ignore /phpstan-baseline.neon export-ignore
/phpunit.xml export-ignore /phpstan.dist.neon export-ignore
/phpunit-watcher.yml export-ignore /phpunit-watcher.yml export-ignore
/phpunit.xml.dist export-ignore

2
.gitignore vendored

@ -8,6 +8,8 @@ coverage/
*.sublime* *.sublime*
clover.xml clover.xml
phpcs.xml phpcs.xml
phpstan.neon
phpunit.xml
.runway-config.json .runway-config.json
.runway-creds.json .runway-creds.json
.DS_Store .DS_Store

@ -82,11 +82,13 @@
"rm server.pid", "rm server.pid",
"echo \"Performance Tests Completed.\"" "echo \"Performance Tests Completed.\""
], ],
"lint": "phpstan --no-progress --memory-limit=256M -cphpstan.neon", "lint": "phpstan --no-progress --memory-limit=256M",
"beautify": "phpcbf --standard=phpcs.xml", "beautify": "phpcbf --standard=phpcs.xml",
"phpcs": "phpcs --standard=phpcs.xml -n", "phpcs": "phpcs --standard=phpcs.xml -n",
"post-install-cmd": [ "post-install-cmd": [
"php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"" "php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"",
"php -r \"if (!file_exists('phpstan.neon')) copy('phpstan.dist.neon', 'phpstan.neon');\"",
"php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\""
] ]
}, },
"suggest": { "suggest": {
@ -97,4 +99,4 @@
"replace": { "replace": {
"mikecao/flight": "2.0.2" "mikecao/flight": "2.0.2"
} }
} }

@ -0,0 +1,14 @@
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- phpstan-baseline.neon
parameters:
level: 6
excludePaths:
- vendor
- flight/util/ReturnTypeWillChange.php
- tests/named-arguments
paths:
- flight
- index.php
treatPhpDocTypesAsCertain: false

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
bootstrap="tests/phpunit_autoload.php"
executionOrder="random"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
convertDeprecationsToExceptions="true"
stopOnError="true"
stopOnFailure="true"
verbose="true"
colors="true">
<coverage processUncoveredFiles="false">
<include>
<directory suffix=".php">flight/</directory>
</include>
<exclude>
<file>flight/autoload.php</file>
</exclude>
</coverage>
<testsuites>
<testsuite name="default">
<directory>tests/</directory>
<exclude>tests/named-arguments/</exclude>
</testsuite>
</testsuites>
<logging />
<php>
<ini name="error_reporting" value="-1"/>
<env name="PHPUNIT_TEST" value="true" force="true" />
</php>
</phpunit>
Loading…
Cancel
Save