Skip to content

Suggestion: Prefix Composer scripts #60

@JoelAlphonso

Description

@JoelAlphonso

Originally posted by @mcaskill in #55 (comment)


I would propose prefixing these scripts and even describing them. For example:

{
    "scripts": {
        "fix:phpcbf": "@php vendor/bin/phpcbf -ps --colors packages/*/src/ --ignore=tests/",
        "lint": [
            "@lint:php",
            "@lint:phpcs",
            "@lint:phpstan"
        ],
        "lint:php": "find packages -type f -name '*.php' -print0 | xargs -0 -n1 -P8 php -l | grep -v '^No syntax errors detected'; test $? -eq 1",
        "lint:phpcs": "./tests/script/phpcs",
        "lint:phpstan": "@php vendor/bin/phpstan analyse",
        "test": [
            "@test:phpunit"
        ],
        "test:phpunit": "./tests/script/phpunit"
    },
    "scripts-descriptions": {
        "fix:phpcbf": "Fix syntax violations with PHPCS",
        "lint": "Run all linting tools",
        "lint:php": "Run syntax check with PHP",
        "lint:phpcs": "Run syntax check with PHPCS",
        "lint:phpstan": "Run static code analysis with PHPStan",
        "test": "Run all testing tools",
        "test:phpunit": "Run all tests with PHPUnit"
    }
}

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions