Verified Commit e2525045 authored by Oliver Klee's avatar Oliver Klee
Browse files

[TASK] Enhance the PHPStan configuration

- configure the checked paths via the configuration file
- do not output a progress bar on CI
- add a baseline file and a command for creating it
- cap the number of processes

Fixes #281
parent 4bde411d
......@@ -15,4 +15,5 @@
/phive.xml
/phpcs.xml export-ignore
/phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/tools/ export-ignore binary
......@@ -102,7 +102,7 @@
"ci:php:cs-fixer": "php-cs-fixer fix --config .php_cs.php -v --dry-run --using-cache false --diff --diff-format=udiff",
"ci:php:lint": "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l",
"ci:php:sniff": "phpcs Classes Configuration Tests",
"ci:php:stan": "phpstan analyse Classes",
"ci:php:stan": "phpstan --no-progress",
"ci:static": [
"@ci:composer:normalize",
"@ci:json:lint",
......@@ -135,6 +135,7 @@
"@php -r 'is_dir($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/\") || mkdir($extFolder, 0777, true);'",
"@php -r 'file_exists($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/tea\") || symlink(__DIR__,$extFolder);'"
],
"phpstan:baseline": ".Build/vendor/bin/phpstan --generate-baseline=phpstan-baseline.neon",
"prepare-release": [
"rm .gitignore",
"rm -rf .Build",
......@@ -152,6 +153,8 @@
"rm Resources/Private/stylelint.config.js",
"rm codeception.yml",
"rm phive.xml",
"rm phpstan-baseline.neon",
"rm phpstan.neon",
"rm phpcs.xml"
]
},
......@@ -175,7 +178,8 @@
"docs:generate": "Renders the extension ReST documentation.",
"fix:php": "Runs all fixers for the PHP code.",
"fix:php:cs": "Fixes the code style with PHP-CS-Fixer.",
"fix:php:sniff": "Fixes the code style with PHP_CodeSniffer."
"fix:php:sniff": "Fixes the code style with PHP_CodeSniffer.",
"phpstan:baseline": "Updates the PHPStan baseline file to match the code."
},
"support": {
"issues": "https://github.com/TYPO3-Documentation/tea/issues",
......
parameters:
ignoreErrors:
includes:
- phpstan-baseline.neon
parameters:
level: 3
bootstrapFiles:
- .Build/vendor/autoload.php
scanDirectories:
- Classes
- Tests
parallel:
# Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI
maximumNumberOfProcesses: 5
level: 3
bootstrapFiles:
- .Build/vendor/autoload.php
paths:
- Classes
scanDirectories:
- Classes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment