Page MenuHomePhabricator

Unable to run composer lint for MediaWiki core
Closed, DuplicatePublic

Description

When running composer test on the HEAD version of MediaWiki core (94248e6373e57f4564bf7ed616e3a1e71c3ed58c) I got this error message:

> parallel-lint --exclude vendor
PHP Parallel Lint version 1.2.0
-------------------------------
Usage:
parallel-lint [sa] [-p php] [-e ext] [-j num] [--exclude dir] [files or directories]
Options:
    -p <php>        Specify PHP-CGI executable to run (default: 'php').
    -s, --short     Set short_open_tag to On (default: Off).
    -a, -asp        Set asp_tags to On (default: Off).
    -e <ext>        Check only files with selected extensions separated by comma.
                    (default: php,php3,php4,php5,phtml,phpt)
    --exclude       Exclude a file or directory. If you want exclude multiple items,
                    use multiple exclude parameters.
    -j <num>        Run <num> jobs in parallel (default: 10).
    --colors        Enable colors in console output. (disables auto detection of color support)
    --no-colors     Disable colors in console output.
    --no-progress   Disable progress in console output.
    --json          Output results as JSON string.
    --checkstyle    Output results as Checkstyle XML.
    --blame         Try to show git blame for row with error.
    --git <git>     Path to Git executable to show blame message (default: 'git').
    --stdin         Load files and folder to test from standard input.
    --ignore-fails  Ignore failed tests.
    -h, --help      Print this help.
    -V, --version   Display this application version
Script parallel-lint --exclude vendor handling the lint event returned with error code 254

See P12493 for more details.

Event Timeline

This is kind of a feature, not a bug. So that CI can do it on changed files, there's no path passed...

See T249554: `composer lint` doesn't actually work in libraryupgrader on mw core too

You can do composer lint . or similar locally

Fair. But the issue is "composer test" runs composer lint, not composer lint . and that is actually how I learned about this (I tried running composer test because that is my go to function to run unit tests locally, and it failed as above).

Should we change this line to read as composer lint .?

Wait, I essentially just suggested https://gerrit.wikimedia.org/r/c/mediawiki/core/+/586443/ which you have already described as a hack and abandoned :/

I'm out of ideas. All that is clear to me at this time is the current ask should be marked as a dupe of T249554

i can't remember if we have a better task. But we should almost have a seperate command that CI would use for linting changed files, and one for eeryone else

You should be able to run composer test . too...

Yeah, I will do that for now. Thanks.