Skip to content

Conversation

@nickvergessen
Copy link
Member

@nickvergessen nickvergessen commented Jan 15, 2026

Comparison

x Before After
Files scanned 4482 4481
Comment - Missing directory mtdowling/jmespath.php which is actually not a file
Local Time 2m19,762s 0m1,665s
CI result 8.2: 3m25s
8.3: 3m36s
8.4: 3m16s
8.5: 3m42s
https://github.com/nextcloud/3rdparty/actions/runs/20912296381
8.2 (old way): 2m54s
8.3: 2s
8.4: 1s
8.5: 3s
https://github.com/nextcloud/3rdparty/actions/runs/21028170705?pr=2259
  • New way only works in PHP 8.3+
  • So I added a version check to switch to the old way otherwise

Will prepare the same for server later

@nickvergessen nickvergessen added this to the Nextcloud 33 milestone Jan 15, 2026
@nickvergessen nickvergessen self-assigned this Jan 15, 2026
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen changed the title ci(lint): Use multiple lines in lint ci(lint): Use multi file argument in lint Jan 15, 2026
@nickvergessen nickvergessen marked this pull request as draft January 15, 2026 12:49
@nickvergessen
Copy link
Member Author

Switching to git ls-files together with a grep seems to weirdly break xargs
Will check again

"@lint-8.2-or-earlier",
"@lint-8.3-or-later"
],
"lint-8.2-or-earlier": "[ $(php -r \"echo PHP_VERSION_ID;\") -ge 80300 ] || git ls-files | grep '.php$' | xargs php -l",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"lint-8.2-or-earlier": "[ $(php -r \"echo PHP_VERSION_ID;\") -ge 80300 ] || git ls-files | grep '.php$' | xargs php -l",
"lint-8.2-or-earlier": "[ $(php -r \"echo PHP_VERSION_ID;\") -ge 80300 ] || git ls-files | grep '.php$' | xargs -P$(nproc) php -l",

We can try something like this to run several processes at the same time (one per core)

@Altahrim
Copy link

For the grep, it's possible to avoid it:

if [[ $(php -r 'echo PHP_VERSION_ID;') -gt 80300 ]]; then
  git ls-files '*.php' '**/*.php' | xargs -n100 -P$(nproc) -- php -l;
else
  git ls-files '*.php' '**/*.php' | xargs -n1 -P$(nproc) -- php -l;
fi

Use n=1 for PHP < 8.3, 100 or more for PHP >= 8.3

@nickvergessen
Copy link
Member Author

Local notes before I loose them:

find . -type f -name '*.php' | sed -r 's|/[^/]+$||' | sort | uniq


find . -type f -name '*.php' -not -name '.*.php' -printf "%h\n" | sort -u | sed 's#$#/*.php#'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants