Automated test towards PHPStan level 6#5230
Merged
Alkarex merged 2 commits intoFreshRSS:edgefrom Mar 26, 2023
Merged
Conversation
Contributes to FreshRSS#4112 With this automated tests, files that are passing Level 6 are tested to avoid regressions towards Level 5 (which is the current baseline for the whole code-base) It is included when calling `make test-all` or can be called specifically by `composer run-script phpstan-next`
Alkarex
commented
Mar 26, 2023
Alkarex
commented
Mar 26, 2023
| "phpcs": "phpcs . -s", | ||
| "phpcbf": "phpcbf . -p -s", | ||
| "phpstan": "phpstan analyse --memory-limit 512M .", | ||
| "phpstan-next": "phpstan analyse --level 6 --memory-limit 512M $(find . -type d -name 'vendor' -prune -o -name '*.php' -o -name '*.phtml' | grep -Fxvf ./tests/phpstan-next.txt | sort | paste -s)", |
Member
Author
There was a problem hiding this comment.
This command finds all relevant *.php and *.phtml files and then remove those that are in phpstan-next.txt before calling PHPStan on the remaining ones.
aledeg
approved these changes
Mar 26, 2023
Alkarex
commented
Mar 26, 2023
| @@ -0,0 +1,93 @@ | |||
| # List of files, which are not yet passing PHPStan level 6 https://phpstan.org/user-guide/rule-levels | |||
Member
Author
There was a problem hiding this comment.
The idea is to remove lines from that list when pull requests are claiming an improved PHPStan level for some specific files.
Example: a5cc7b2
Closed
Alkarex
added a commit
that referenced
this pull request
Mar 26, 2023
* Cleaning code and typehinting * Fix remarque alphabetic order * Cleaning * rollback self:: * Update Context.php * Fix remarques * Fix remarques * Fix remarques * Remarque's from Alkarex * Remarque's from Alkarex * Cast higher up * Fix Level 5 * Claiming Level 6 Cf. #5230 * Address my comments * indexController as Level 6 as well * Fixed some wrong types --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributes to #4112
With this automated test, files that are passing Level 6 are tested to avoid regressions towards Level 5 (which is the current baseline for the whole code-base)
It is included when calling
make test-allor can be called specifically bycomposer run-script phpstan-next