mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-22 17:56:12 +01:00

[TASK] Enhance the PHPStan configuration (#302)

- 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
This commit is contained in:
Oliver Klee 2021-09-13 04:06:10 +02:00 committed by GitHub
parent dc07603e21
commit a173900a7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 8 deletions

1
.gitattributes vendored
View file

@ -15,4 +15,5 @@
/phive.xml /phive.xml
/phpcs.xml export-ignore /phpcs.xml export-ignore
/phpstan.neon export-ignore /phpstan.neon export-ignore
/phpstan-baseline.neon export-ignore
/tools/ export-ignore binary /tools/ export-ignore binary

View file

@ -104,7 +104,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: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: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:sniff": "phpcs Classes Configuration Tests",
"ci:php:stan": "phpstan analyse Classes", "ci:php:stan": "phpstan --no-progress",
"ci:static": [ "ci:static": [
"@ci:composer:normalize", "@ci:composer:normalize",
"@ci:json:lint", "@ci:json:lint",
@ -137,6 +137,7 @@
"@php -r 'is_dir($extFolder=__DIR__.\"/.Build/public/typo3conf/ext/\") || mkdir($extFolder, 0777, true);'", "@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);'" "@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": [ "prepare-release": [
"rm .gitignore", "rm .gitignore",
"rm -rf .Build", "rm -rf .Build",
@ -154,6 +155,8 @@
"rm Resources/Private/stylelint.config.js", "rm Resources/Private/stylelint.config.js",
"rm codeception.yml", "rm codeception.yml",
"rm phive.xml", "rm phive.xml",
"rm phpstan-baseline.neon",
"rm phpstan.neon",
"rm phpcs.xml" "rm phpcs.xml"
] ]
}, },
@ -177,7 +180,8 @@
"docs:generate": "Renders the extension ReST documentation.", "docs:generate": "Renders the extension ReST documentation.",
"fix:php": "Runs all fixers for the PHP code.", "fix:php": "Runs all fixers for the PHP code.",
"fix:php:cs": "Fixes the code style with PHP-CS-Fixer.", "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": { "support": {
"issues": "https://github.com/TYPO3-Documentation/tea/issues", "issues": "https://github.com/TYPO3-Documentation/tea/issues",

2
phpstan-baseline.neon Normal file
View file

@ -0,0 +1,2 @@
parameters:
ignoreErrors:

View file

@ -1,7 +1,18 @@
includes:
- phpstan-baseline.neon
parameters: parameters:
parallel:
# Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI
maximumNumberOfProcesses: 5
level: 3 level: 3
bootstrapFiles: bootstrapFiles:
- .Build/vendor/autoload.php - .Build/vendor/autoload.php
paths:
- Classes
scanDirectories: scanDirectories:
- Classes - Classes
- Tests