phpro / grumphp

A PHP code-quality tool
MIT License
4.15k stars 431 forks source link

Out of memory error when trying to add grumphp #613

Closed artemkolotilkin closed 5 years ago

artemkolotilkin commented 5 years ago
Q A
Version 0.15.0
Bug? yes
New feature? no
Question? no
Documentation? no
Related tickets

My configuration

parameters:
  git_dir: "."
  process_async_limit: 10
  process_async_wait: 1000
  process_timeout: 60
  tasks:
    phpcs:
      standard:
        - vendor/drupal/coder/coder_sniffer/Drupal
        - vendor/drupal/coder/coder_sniffer/DrupalPractice
      ignore_patterns:
        - libraries/
      triggered_by:
        - php
        - module
        - inc

Steps to reproduce:

# Add GrumpHP to an existing Drupal 8 project
composer require --dev phpro/grumphp

# Due to requirements of our hosting environment (Acquia) we have to keep "vendor" folder in git.
So when I added grumphp to a project, the only diff are the additions in the vendor folder.
Then, when I'm trying to commit this I'm getting an out of memory error.

# Your actions
# Please add the steps on how to reproduce the issue here.

# Run GrumpHP:
git add -A && git commit -m"Test"

Result:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in <project-name>/vendor/gitonomy/gitlib/src/Gitonomy/Git/Parser/DiffParser.php on line 113
veewee commented 5 years ago

Hi @ artemkolotilkin

It is recommended to ignore your vendor folder. The diff will be huge! No way it fits in 143MB.

You could also increasy the memory setting in your php.ini