Phpunit: Remove tools folders from all packages

Created on 7 Jul 2020  路  11Comments  路  Source: sebastianbergmann/phpunit

On weak processors the indexing of project may have to long time and needs to more resources.
As I noticed, each dependent package have folder tools, that takes over 10 MB.
I suggest remove any tools folders from each packages. You can use these tools as a independent package, but not as a standalone file in each package.

image

Size of vendor/phpunit

ls
php-code-coverage php-file-iterator php-invoker php-text-template php-timer php-token-stream phpunit

du -sh .
288M .

find . -type d -name "tools" -exec rm -rf "{}" +;

du -sh
157M .
Removed 130 MB (!!!!)

Size of vendor/sebastian

ls sebastian/
code-unit diff global-state recursion-context version code-unit-reverse-lookup environment object-enumerator resource-operations comparator exporter object-reflector type

du -sh sebastian/
327M sebastian/

find sebastian/ -type d -name "tools" -exec rm -rf "{}" +;

du -sh sebastian/
138M sebastian/

Removed 190 MB (!!!!)

Most helpful comment

It's not for phpstorm only.

  1. It's takes extra internet traffic
  2. It's takes extra time to download it
  3. It's takes more disk space
  4. Docker containers are bloat

It's no problem to extract your tools to one package and reuse it.
Do you have arguments to do it?

All 11 comments

You need to configure PhpStorm to ignore the tools folder.

It's not for phpstorm only.

  1. It's takes extra internet traffic
  2. It's takes extra time to download it
  3. It's takes more disk space
  4. Docker containers are bloat

It's no problem to extract your tools to one package and reuse it.
Do you have arguments to do it?

Can't it be included into .gitattributes?

Wait... it's already export-ignored. @xepozz how do you install it?

To reproduce you can try the next snippet

mkdir -p /tmp/phpunit && cd /tmp/phpunit && echo '{"minimum-stability": "dev"}' > composer.json && composer req phpunit/phpunit -v 2>/dev/null && du -hs vendor/phpunit

In other projects I do just composer install without any flags.

I think it's important part, because many developers install dependencies without any flags.

That is correct. Majority of developers I know do not use --prefer-dist or --prefer-stable. At least in development environments.

@sebastianbergmann ?

I think it's important part, because many developers install dependencies without any flags.

I fail to see why it should be my problem that other people do not use Composer correctly.

I will not change the way I work, sorry.

@xepozz if you use "minimum-stability": "dev" you probably always need "prefer-stable": true

mkdir -p /tmp/phpunit && cd /tmp/phpunit && echo '{"minimum-stability": "dev", "prefer-stable": true}' > composer.json && composer req phpunit/phpunit -v 2>/dev/null && du -hs vendor/phpunit

I think it's important part, because many developers install dependencies without any flags.

I fail to see why it should be my problem that other people do not use Composer correctly.

I will not change the way I work, sorry.

The problem not only about using Composer.
I don't understand the purpose of using copy-pasting instead of reusing the dev dependencies.

Is there any reason to not move into composer require-dev?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ezzatron picture ezzatron  路  3Comments

kunjalpopat picture kunjalpopat  路  4Comments

keradus picture keradus  路  4Comments

edyan picture edyan  路  4Comments

AnmSaiful picture AnmSaiful  路  4Comments