From d8381cbd572d80cc50b3776dcfa1581680d1b0ec Mon Sep 17 00:00:00 2001 From: Bart Jaskulski <bjaskulski@protonmail.com> Date: Tue, 21 Feb 2023 13:41:52 +0100 Subject: [PATCH] fix: remove false positives about linting Previously `grep` mangled exit code for job because when grep doesn't find any matching lines, it returns 1, which invalidates our pipeline. On the other hand, any found errors are treated as expected result because lines matched and grep returned valid exit code `0`. Mitigate this behavior by manually overriding exit code with simple boolean gate. Signed-off-by: Bart Jaskulski <bjaskulski@protonmail.com> --- includes/tests/lint.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/tests/lint.yml b/includes/tests/lint.yml index 80a36ad..069ce75 100644 --- a/includes/tests/lint.yml +++ b/includes/tests/lint.yml @@ -2,11 +2,11 @@ stage: tests script: - composer install --no-dev - - find -name '*.php' -print0 |xargs -n1 -0 -P16 php -l |grep -v "No syntax errors detected" + - find -name '*.php' -print0 |xargs -n1 -0 -P16 php -l |grep -v "No syntax errors detected" || exit 0 -lint:8.1: +lint:8.2: <<: *lint-tmpl - image: gitlab.wpdesk.dev:5050/wpdesk/docker-tests/php-box:8.1 + image: gitlab.wpdesk.dev:5050/wpdesk/docker-tests/php-box:8.2 lint:7.2: <<: *lint-tmpl -- GitLab