SnowdogApps / magento2-frontools

Set of front-end tools for Magento 2 based on Gulp.js
MIT License
430 stars 142 forks source link

Add PHP Code Sniffer support #45

Closed Igloczek closed 4 years ago

Igloczek commented 8 years ago

I want to add a PHP Code Sniffer support to watch and check validity of templates live, without using Magento CLI / other ways to trigger them manually.

Check if we have to stick with super old version shipped with M2 - current is 2.6, but M2 use 1.5 (2014) Same about PHPUnit - current is 5.4, but in M2 we have 4.1 (again 2014)

Links: https://github.com/sebastianbergmann/phpunit https://github.com/squizlabs/PHP_CodeSniffer https://github.com/JustBlackBird/gulp-phpcs

timneutkens commented 8 years ago

Cool, big fan of phpcs and phpmd. Actually kinda authored gulp-phpmd which uses the same programmatic api as gulp-phpcs.

You just want to integrate the PSR-2 check right?

Igloczek commented 8 years ago

I tries to stick with tests build-in in M2, but if PHPMD brings something new / do it better, maybe it's worth to check it.

timneutkens commented 8 years ago

It's mainly to check for code complextion and things like that, so it might not be relevant for a front-end build. Except when we watch all files ofcourse. There was an excellent ruleset for magento1 which checked for model loading inside a foreach and some other cool stuff.

timneutkens commented 8 years ago

Just saw a blog post from Magento about coding standards using phpcs. They released it as a seperate package: https://github.com/magento/marketplace-eqp

Igloczek commented 8 years ago

I'm still waiting for some response on Magento Community Forum... https://community.magento.com/t5/Programming-Questions/PHP-Static-tests-for-front-end-devs/m-p/40060