LiipFunctionalTestBundle icon indicating copy to clipboard operation
LiipFunctionalTestBundle copied to clipboard

[2.x] Add code checks

Open alexislefebvre opened this issue 7 years ago • 5 comments

Add jobs in Travis CI for:

  • PHP-CS-Fixer
  • PHPStan
  • PHPMD ?

Code analysis is fast but having two different jobs will make results easier to read if there's an error.

We could rely on Docker image https://github.com/jakzal/phpqa instead of adding dependencies to dev.

Some ideas for the configuration of these tools:

  • https://github.com/phpstan/phpstan-symfony
  • https://github.com/phpstan/phpstan-strict-rules (only if it doesn't require too much work)

Assigned to @Jean85

alexislefebvre avatar Nov 16 '18 17:11 alexislefebvre

Why you don't want to rely on require-dev? IMO it's hard for contributors later, since they have to run additional commands to run the checks locally...

Jean85 avatar Nov 16 '18 21:11 Jean85

Using Docker was a suggestion. You're right, it's easier to install analysis tools with Composer.

alexislefebvre avatar Nov 16 '18 22:11 alexislefebvre

I was trying to work on this but it seems a big mess: we have too many dev dependencies which I cannot skip or the analysis will fail, and at the same time PHPCR doesn't allow PHPUnit 7, which is required to use phpstan/phpstan-phpunit...

It seems to me that we're having too many optional dependencies in this package. Maybe we should split them?

Jean85 avatar Nov 16 '18 23:11 Jean85

we have too many dev dependencies which I cannot skip or the analysis will fail

Could you please explain this? What is failing?

About PHPCR, we may drop it from this bundle, there have been no issue about PHPCR during five years, maybe it's not used much.

alexislefebvre avatar Nov 17 '18 16:11 alexislefebvre

PHPStan requires all used dependencies to be installed because it need to know all symbols used in our code.

Jean85 avatar Nov 17 '18 17:11 Jean85