Skip to content

project validate --only=phpstan: local phpstan.neon with excludePaths causes unmarshal failure #833

@wexoag

Description

@wexoag

Steps to reproduce

  1. Project with extensions in custom/plugins/ and custom/static-plugins/
  2. Add a phpstan.neon to the project root:
    parameters:
        level: 6
        paths:
            - custom/static-plugins
        excludePaths:
            analyseAndScan:
                - custom/plugins/Swag*
            analyse:
                - vendor
  3. Run: shopware-cli project validate . --local-only --only=phpstan --reporter=json

Expected behavior

PHPStan respects the local neon config. Extensions matching excludePaths are excluded from analysis without errors.

Actual behavior

PHPStan seems to be invoked per source directory with the directory as a CLI argument, which overrides the neon's paths. When a source directory (e.g. SwagPlatformDemoData/src) matches excludePaths, PHPStan
finds no files to analyse and the output fails to unmarshal at https://github.com/shopware/shopware-cli/blob/main/internal/verifier/phpstan.go#L91.

Workaround

Use ignore_extensions in .shopware-project.yml

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions