Skip to content

Automated test towards PHPStan level 6#5230

Merged
Alkarex merged 2 commits intoFreshRSS:edgefrom
Alkarex:phpstan-next
Mar 26, 2023
Merged

Automated test towards PHPStan level 6#5230
Alkarex merged 2 commits intoFreshRSS:edgefrom
Alkarex:phpstan-next

Conversation

@Alkarex
Copy link
Member

@Alkarex Alkarex commented Mar 26, 2023

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-all or can be called specifically by composer run-script phpstan-next

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 Alkarex added the System care Everything related to system care label Mar 26, 2023
@Alkarex Alkarex added this to the 1.22.0 milestone 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)",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -0,0 +1,93 @@
# List of files, which are not yet passing PHPStan level 6 https://phpstan.org/user-guide/rule-levels
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to remove lines from that list when pull requests are claiming an improved PHPStan level for some specific files.
Example: a5cc7b2

@Alkarex Alkarex merged commit f3af3f0 into FreshRSS:edge Mar 26, 2023
@Alkarex Alkarex deleted the phpstan-next branch March 26, 2023 21:19
@Alkarex Alkarex mentioned this pull request Mar 26, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

System care Everything related to system care

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants