Skip to content

New developer command to test all third-party extensions#228

Merged
Alkarex merged 5 commits intomasterfrom
third-party-tests
Apr 11, 2024
Merged

New developer command to test all third-party extensions#228
Alkarex merged 5 commits intomasterfrom
third-party-tests

Conversation

@Alkarex
Copy link
Copy Markdown
Member

@Alkarex Alkarex commented Apr 7, 2024

* `composer run-script phpstan-third-party`
* Rename the directory for generate.php to `third-party` instead of `tmp`
* Take advantage of PHPStan checkMissingOverrideMethodAttribute https://phpstan.org/config-reference#checkmissingoverridemethodattribute
* Detected and fixed bug in URL of https://github.com/tunbridgep/freshrss-invidious
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Apr 7, 2024

Ping @aledeg @Frenzie if you have any comments

Comment on lines 13 to 15
if (file_exists($tempFolder)) {
// TODO: Improve by keeping git copy if possible (e.g. fetch + reset)
exec("rm -rf -- {$tempFolder}");
Copy link
Copy Markdown
Member Author

@Alkarex Alkarex Apr 7, 2024

Choose a reason for hiding this comment

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

For a future PR: help welcome for some commands to keep the local git copies and update them via git safely

"phpstan": "phpstan analyse --memory-limit 512M .",
"phpstan-next": "phpstan analyse --level 9 --memory-limit 512M $(find . -type d -name 'vendor' -prune -o -name '*.php' -o -name '*.phtml' | grep -Fxvf ./tests/phpstan-next.txt | sort | paste -s -)",
"phpstan-next": "phpstan analyse --memory-limit 512M -c phpstan-next.neon .",
"phpstan-third-party": "phpstan analyse --memory-limit 512M -c phpstan-third-party.neon .",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For a future PR: it would be nice to add that during the GitHub Actions for generate.php to e.g. report warnings or even exclude failing extensions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This memory limit thing is for GitHub Actions btw?

Copy link
Copy Markdown
Member Author

@Alkarex Alkarex Apr 7, 2024

Choose a reason for hiding this comment

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

It used to fail even on my machine without it, but I have not tested recently, and now that our code base has much fewer errors, it might work with the default value (which is lower)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ahh I figured it was the other way around. xD

@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Apr 7, 2024

Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Apr 7, 2024
@Alkarex
Copy link
Copy Markdown
Member Author

Alkarex commented Apr 7, 2024

Corresponding PR in core FreshRSS FreshRSS/FreshRSS#6273

Alkarex added a commit to FreshRSS/FreshRSS that referenced this pull request Apr 10, 2024
* PHP 8.3 #[\Override]
https://php.watch/versions/8.3/override-attr

With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute

And modified the call to phpstan-next on the model of FreshRSS/Extensions#228 (more robust than the find method, which gave some strange errors)

* Update extension example accordingly
@Alkarex Alkarex merged commit 01f3473 into master Apr 11, 2024
@Alkarex Alkarex deleted the third-party-tests branch April 11, 2024 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants