Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPStan is not a linter #41

Open
mxr576 opened this issue Oct 8, 2024 · 0 comments
Open

PHPStan is not a linter #41

mxr576 opened this issue Oct 8, 2024 · 0 comments

Comments

@mxr576
Copy link

mxr576 commented Oct 8, 2024

I like these handy shortcut commands introduced by this DDEV extension but I think calling PHPStan a linter is semantically incorrect, it is a static code analyzer. PHPCS is somewhere in between, it depends how it is configured.

For reference, these are my usual Composer scripts on Drupal projects:

    "scripts": {
        "lint:check": [
            "@lint:composer:check  # todo check composer.json-s in modules",
            "@lint:php:check web/modules/custom"
        ],
        "lint:composer:check": [
            "@composer validate",
            "@composer normalize --dry-run"
        ],
        "lint:composer:fix": [
            "@composer normalize # todo check composer.json-s in modules"
        ],
        "lint:fix": [
            "@lint:composer:fix # todo check composer.json-s in modules",
            "@lint:php:fix web/modules/custom"
        ],
        "lint:php:check": "phpcs --standard=phpcs.xml.dist --parallel=\"$( (nproc || sysctl -n hw.logicalcpu || echo 4) 2>/dev/null)\"",
        "lint:php:fix": "phpcbf --standard=phpcs.xml.dist --parallel=\"$( (nproc || sysctl -n hw.logicalcpu || echo 4) 2>/dev/null)\"",
        "static:check": [
            "@static:phpstan"
        ],
        "static:phpstan": [
            "Composer\\Config::disableProcessTimeout",
            "vendor/bin/phpstan"
        ],
        "test": [
            "@test:phpunit web/modules/custom --debug"
        ],
        "test:phpunit": [
            "Composer\\Config::disableProcessTimeout",
            "vendor/bin/phpunit -c web/core"
        ]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant