phpro / grumphp

A PHP code-quality tool
MIT License
4.11k stars 429 forks source link

phpstan not showing errors #1050

Closed talhaamir4130 closed 1 year ago

talhaamir4130 commented 1 year ago
Q A
Version 0.19.1
Bug? yes
New feature? no
Question? yes
Documentation? no

My configuration

grumphp:
    hooks_preset: local
    process_timeout: 600
    fixer:
        enabled: true
        fix_by_default: true
    parallel:
        enabled: true
        max_workers: 32
    tasks:
        phpcsfixer:
            verbose: false
            rules: ['@PSR1', '@PSR2', '@Symfony', '@PhpCsFixer', -concat_space]
        phpstan:
            configuration: './phpstan.neon'

phpstan file config:

parameters:
  level: 7
  reportUnmatchedIgnoredErrors: false
  checkGenericClassInNonGenericObjectType: false
  paths:
    - "%rootDir%/../../../src"
    - "%rootDir%/../../../tests"
  excludePaths:
    - "%rootDir%/../../../tests/features"
    - "%rootDir%/../../../var"

phpstan config location is project/phpstan.neon

When I run vendor/bin/phpstan analyse src tests I see errors, but when I run vendor/bin/grumphp run I don't see any phpstan errors

Screenshot from 2022-10-28 11-19-13

Screenshot from 2022-10-28 11-20-32

veewee commented 1 year ago

Hello,

Can you try it out with latest grumphp version? The one you are using is quite old... What are the paths in phpstan? Are they included in git? Because it seems like they are going out of the root of your prohect at first sight?

talhaamir4130 commented 1 year ago

I think the path in the phpstan.neon shouldn't matter because phpstan itself uses that file and works fine.

I can't move to latest grumphp version right now because more packages dependencies needs upgradation too, I don't wanna do that yet.

veewee commented 1 year ago

Closing this one for now. Feel free to reopen if you are able to reproduce with a newer version of GrumPHP.