phpro / grumphp

A PHP code-quality tool
MIT License
4.14k stars 430 forks source link

Re-add memory_limit option for phpstan #614

Closed josefbehr closed 4 years ago

josefbehr commented 5 years ago
Q A
Version GrumPHP 0.15.0
Bug? yes
New feature? no
Question? yes
Documentation? no

Somewhere along the lines (could not identify the commit) the memory_limit option for phpstan was removed. Why, I have no idea. But it leads to phpstan aborting because of insufficient memory. Why was this option removed? Please re-add it.

My configuration

# grumphp.yml
parameters:
    magento_dir: "."
    bin_dir: "./vendor/bin"
    git_dir: "."
    hooks_dir: ~
    hooks_preset: local
    stop_on_failure: false
    ignore_unstaged_changes: false
    hide_circumvention_tip: true
    process_async_limit: 10
    process_async_wait: 1000
    process_timeout: 180
    ascii:
        failed: grumphp-grumpy.txt
        succeeded: grumphp-happy.txt
    tasks:
        #codeception: ~
        composer: 
            file: "./composer.json"
            no_check_all: true
            no_check_lock: false
            no_check_publish: false
            with_dependencies: false
            strict: false
        #composer_require_checker: ~
        #file_size: ~
        git_blacklist:
            keywords:
                - "die("
                - "var_dump("
                - "exit;"
                - "exit"
                - "console.log("
            whitelist_patterns:
            - /^app\/(.*)/
            triggered_by: ['php']
        git_branch_name: ~
        git_commit_message: ~
        #grunt: ~
        #gulp: ~
        jsonlint:
            ignore_patterns: ["dev"]
        phpcs:
            standard: "%magento_dir%/dev/tests/static/framework/Magento"
            severity: ~
            error_severity: ~
            warning_severity: 6
            tab_width: 4
            report: summary
            report_width: ~
            whitelist_patterns:
                - /^\/app\/code\/(.*)/
            encoding: ~
            ignore_patterns: ["dev"]
            sniffs: []
            triggered_by: [php]
        phpcsfixer2: ~
        phpcpd:
            directory: '.'
            exclude: ['vendor', 'dev', 'setup', 'generated', 'update']
            names_exclude: []
            regexps_exclude: []
            fuzzy: false
            min_lines: 5
            min_tokens: 70
            triggered_by: ['php']
        phplint:
            exclude: ['vendor']
        phpmd:
            ruleset: [%magento_dir%/dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml]
            whitelist_patterns: ['/^app\/code\/(.*)/']
            exclude: ['dev', 'generated', 'vendor', 'update', 'setup']
            ruleset: ['cleancode', 'codesize', 'naming']
            triggered_by: ['php']
        phpparser: ~
        phpspec:
            config_file: ~
            format: ~
            stop_on_failure: false
            verbose: false
        phpstan:
            autoload_file: ~
            configuration: ~
            level: 0
            force_patterns: []
            ignore_patterns: ['dev', 'generated', 'vendor', 'update', 'setup']
            triggered_by: ['php']
        phpversion:
            project: "7.1"
        securitychecker:
            lockfile: ./src/composer.lock
            format: ~
            end_point: ~
            timeout: ~
            run_always: false
        shell: ~
        xmllint:
            ignore_patterns: ["dev"]
        yamllint:
            ignore_patterns: ["dev"]
    testsuites: []
    extensions: []

Steps to reproduce:

# Generate empty folder
mkdir tmp
cd tmp
git init
echo "vendor" > .gitignore
pbpaste > grumphp.yml
composer require --dev phpro/grumphp

# Run GrumpHP:
./vendor/bin/grumphp run

Result:

![Screenshot 2019-03-25 at 15 02 36](https://user-images.githubusercontent.com/4368880/54925889-840c1980-4f0f-11e9-959c-9fb43df568e5.png)
BrentRobert commented 4 years ago

Looks like this has been fixed in 0.15.1