overtrue/phplint

after update: sh: syntax error: unexpected "then"

drexlma opened this issue · 13 comments

i use gitlab. it works many days, but now:



test:lint:
  stage: test
  image: overtrue/phplint
  allow_failure: true
  before_script:
  - php -v
  script:
    - composer require overtrue/phplint
    - echo "Syntax checking PHP files"
    - vendor/bin/phplint ./

Debug:

Using docker image sha256:1712ab9737368cb7d72eb97192ab7f1aa4a811ebeaddf7765ed4b77034120b05 for overtrue/phplint with digest overtrue/phplint@sha256:173f5155210f68db476378701e96485193cd728a9465dd44a14a307740fff6cb ...
+ '[' '!' -z  ]
+ sh -c '/root/.composer/vendor/bin/phplint sh -c if [ -x /usr/local/bin/bash ]; then
	exec /usr/local/bin/bash 
elif [ -x /usr/bin/bash ]; then
	exec /usr/bin/bash 
elif [ -x /bin/bash ]; then
	exec /bin/bash 
elif [ -x /usr/local/bin/sh ]; then
	exec /usr/local/bin/sh 
elif [ -x /usr/bin/sh ]; then
	exec /usr/bin/sh 
elif [ -x /bin/sh ]; then
	exec /bin/sh 
elif [ -x /busybox/sh ]; then
	exec /busybox/sh 
else
	echo shell not found
	exit 1
fi
'
sh: syntax error: unexpected "then"

The docker image you use is still under development (9.0-dev). Please use a tag (either 7.4, 8.0, 8.1 or 8.2) that reference a stable version.

If I'm wrong, please specify version phplint --version and PHP version you use on your gitlab plaform.

Docker image with latest tag reference the dev version 9.0 (that will still be update in next days) !

thx

u use this image: https://hub.docker.com/layers/overtrue/phplint/latest/images/sha256-762a453705f573d47bf7787f50d0646db3851f62efc559a319fea4978a35834f?context=explore

same problem with 8.2 and 8.1

it works with

Using docker image sha256:71cfa23f4730d4e3be4117155f10707dac239e12f0b2d3a5c272510261decaa4 for overtrue/phplint with digest overtrue/phplint@sha256:762a453705f573d47bf7787f50d0646db3851f62efc559a319fea4978a35834f ...

  • /root/.composer/vendor/bin/phplint
    phplint 2.0.2 by overtrue and contributors.

Bildschirm­foto 2023-02-05 um 17 10 41

also with 7.4

it works with

Using docker image sha256:71cfa23f4730d4e3be4117155f10707dac239e12f0b2d3a5c272510261decaa4 for overtrue/phplint with digest overtrue/phplint@sha256:762a453705f573d47bf7787f50d0646db3851f62efc559a319fea4978a35834f ...

/root/.composer/vendor/bin/phplint
phplint 2.0.2 by overtrue and contributors.

This version is very outdated https://github.com/overtrue/phplint/releases/tag/2.0.2

On Gitlab support, I was not yet here when it was applied #116

Do you want to provide a PR to fix this issue ?

I've not GitLab env available to test/do something

Aah :) I'll deal with that for the next few days

@drexlma If you want to contribute, I'll suggest to do it with the main branch that begin the official source code of major version 9.0 (that will be released shortly now).

Version 9.0.4 is scheduled for tomorrow, if you've time to give a chance to fix it, it will be very cool !!!

I need more time :D haven't got around to it yet

Any news ?

Any news ?

/cc @drexlma

After a reasonable period to wait for feedback, I will close this issue.
If you think you can offer a contribution, @drexlma you are free to reopen this ticket.

@drexlma cc @llaville
this worked for me

lint-php:
image:
name: "overtrue/phplint:8.1"
entrypoint: [""]
stage: lint
retry: 1
allow_failure: false
variables:
INPUT_PATH: "./"
INPUT_OPTIONS: "--exclude=vendor --no-configuration --no-cache"
script: /root/.composer/vendor/bin/phplint ./ --exclude=vendor