Rector: running composer complete-check on windows

Created on 6 Nov 2019  路  12Comments  路  Source: rectorphp/rector

| Subject | Details |
| :------------- | :----------------------------------------------------------- |
| Rector version | current master |
| PHP version | PHP 7.3 |
| Full Command | composer complete-check --debug |

Current Behaviour


C:\Users\username\PhpstormProjects\rector>composer complete-check

vendor/bin/ecs check bin packages src tests utils --ansi
'vendor' n鈥檈st pas reconnu en tant que commande interne
ou externe, un programme ex茅cutable ou un fichier de commandes.
Script vendor/bin/ecs check bin packages src tests utils --ansi handling the check-cs event returned with error code 1

The error message is in french. It can be roughly translated to
'vendor' was not recognized as an internal or external command nor an executable program or command file

While trying to fiddle in this, I managed to make it work for ECS by replacing
"vendor/bin/ecs" by "vendor\bin\ecs.bat" but I'm not sure how this can be fixed within composer...

Expected Behaviour

Being able to launch the command or having a fallback command to run all the tests and code style to contribute

All 12 comments

This one is simple. Just update the composer.json paths like this:

-"vendor/bin/ecs
+"ecs

For all commands there. If it helps, please send PR with this change

You're right, it works fine. I'll try to do the PR

Is it normal that I get more than a thousand suggested changes from ecs?

Here are the checkers applied:

  • PhpCsFixer\Fixer\Whitespace\LineEndingFixer
  • Symplify\CodingStandard\Fixer\Commenting\BlockPropertyCommentFixer

Is it normal that I get more than a thousand suggested changes from ecs?

Probably line endings from Windows. It enforces Windows endings, while this code has *nix line endings.

I quick workaround is to exclude these 2 files locally in ecs.yaml

I'll try to see tomorrow if I can make it OS agnostic. Ideally, everything should be able to be run on windows

Agreed. That would be amazing :+1:

@orklah I just found out Travis supports Windows for a couple of months.
I'm trying to add Windows testsuite here: https://github.com/rectorphp/rector/pull/2278

Nice! Just checked, the path seems to work! I'll take a look to the line feed issue.

I created PR #2281 for LineEndingFixer.

There is an other issue on BlockPropertyCommentFixer in simplify/coding-standards but it uses hard-coded PHP_EOL. I'll create an issue on the repo.

Once the BlockPropertyCommentFixer resolved, there are other issue on ecs. I'll look at that later

Thank you

I maintain symplify/coding-standards too, so if you proppose PR there, I can merge it quickly. Here is the repository for PR: https://github.com/Symplify/Symplify

Yeah, I noticed :)

I'm reading the history on PR trying to drop hard-coded PHP_EOL, seems like it was tried multiple times.

I'll look into it.

Windows is not priority at the moment and needs more work.
Closing as answered and waiting for PR.

Was this page helpful?
0 / 5 - 0 ratings