Wikimate
Wikimate copied to clipboard
Add linters or other code checkers
As mentioned here:
The main standards are the PSRs, and I've looked into some occasionally but am not well versed in any, and am not sure Wikimate even meets the basic coding or PHPDoc standards in all relevant aspects.
It may be worth setting up automated checks for those PSRs or other good practices. I don't know if there are tools that are commonly used/recommended for this type of task in the PHP world, so I'll just leave a few links from a cursory search here, and later we might refine/improve the options.
- OskarStark/phpstan-ga: GithubAction for PHPStan
- OskarStark/php-cs-fixer-ga: GithubAction for PHP-CS-Fixer
- chekalsky/phpcs-action: Github Action helps you check your code with PHP_CodeSniffer
I also found the Setup PHP action, which appears to be quite popular, but seems like a generic tool to set up an environment to run PHP tasks in GitHub actions. There's also the PHP Actions organization, which appears to contain multiple PHP-related GitHub Actions, but I'm not sure how it relates to the other options listed above.
FYI, I didn't encounter the latter two yet, but giving PHPStan a spin locally was already on my to-do list before we wrap up v1.0. Don't know what to expect of it, or the others, though.
Cross-referencing #142 and #143.
I gave PHP-CS-Fixer a whirl, but in running a similar PSR-12 check, it adds nothing that PHP_CodeSniffer doesn't already do, while the latter is more informative of how a rules standard isn't met (and leaves any automatic fixes to the separate phpcbf
tool). So I removed PHP-CS-Fixer.
Apparently the super-linter
action supports PHP linters. It might be an easier way to set this up.