Skip to content

Commit

Permalink
Merge branch 'develop' into fix_getrights_loadrights
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Jan 21, 2025
2 parents 8b3c958 + 8733336 commit d37897b
Show file tree
Hide file tree
Showing 185 changed files with 3,314 additions and 1,461 deletions.
50 changes: 29 additions & 21 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,16 @@ jobs:
key: pre-commit-4|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

# Run all the precommit tools (defined in pre-commit-config.yaml).
# We can force exclusion of some of them here.
- name: Run pre-commit hooks
env:
# SKIP is used by pre-commit to not execute certain hooks
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer
- name: Extract PHP version
id: extract-php-version
run: |
set -o pipefail
pre-commit gc
pre-commit run --show-diff-on-failure --color=always --all-files | tee "${RAW_LOG}"
# The next uses git, which is slow for a bit repo.
# - name: Get all changed php files (if PR)
# id: changed-php
# uses: tj-actions/changed-files@v45
# if: env.gh_event == 'pull_request'
# with:
# files: |
# **.php
# shellcheck disable=SC2016
PHP_VERSION=$(sed -n 's/.*\$arrayphpmaxversionwarning\s*=\s*array\s*(\s*\([0-9]\+\)\s*,\s*\([0-9]\+\).*/\1.\2/p' htdocs/install/check.php)
echo "PHP_VERSION=$PHP_VERSION" >> "$GITHUB_ENV"
- name: Setup PHPCS
uses: shivammathur/setup-php@v2
# Install when we're going to run phpcs
# Install proper php version, and also install phpcs which may be needed
if: |
! cancelled() &&
(
Expand All @@ -89,16 +77,36 @@ jobs:
(
env.gh_event == 'push'
&& (
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
github.event.ref == 'refs/heads/develop'
|| endsWith(github.event.ref, '.0')
)
)
)
with:
php-version: 8.1
php-version: ${{ env.PHP_VERSION }} # Version from check.php
coverage: none # disable xdebug, pcov
tools: phpcs

# Run all the precommit tools (defined into pre-commit-config.yaml).
# We can force exclusion of some of them here.
- name: Run pre-commit hooks
env:
# SKIP is used by pre-commit to not execute certain hooks
SKIP: no-commit-to-branch,php-cs,php-cbf,trailing-whitespace,end-of-file-fixer
run: |
set -o pipefail
pre-commit gc
pre-commit run --show-diff-on-failure --color=always --all-files | tee "${RAW_LOG}"
# The next uses git, which is slow for a bit repo.
# - name: Get all changed php files (if PR)
# id: changed-php
# uses: tj-actions/changed-files@v45
# if: env.gh_event == 'pull_request'
# with:
# files: |
# **.php

- name: Run some pre-commit hooks on selected changed files only
if: "! cancelled() && steps.changed-php.outputs.any_changed == 'true'"
env:
Expand Down
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,11 @@ script:
- |
echo "Unit testing"
# Ensure we catch errors with -e. Set this to +e instead of -e if you want to go to the end to see dolibarr.log file.
set -e
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php
phpunitresult=$?
# Execute phpunit, check its exit status and that the phpunit output shows a test summary
phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php | tee /dev/tty | grep -qE "(OK .*[0-9]+ tests.*[0-9]+ assertions|Tests: [0-9]+)" ; phpunitresult=$((PIPESTATUS[0]?PIPESTATUS[0]:PIPESTATUS[2]))
echo "Phpunit return code = $phpunitresult"
set +e
# Comment next line if you want to go to the end to see the dolibarr.log file.
[ $phpunitresult == 0 ] || exit $phpunitresult
echo
after_script:
Expand Down
38 changes: 1 addition & 37 deletions dev/build/phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6576,12 +6576,6 @@ parameters:
count: 1
path: ../../../htdocs/compta/sociales/card.php

-
message: '#^Variable \$resteapayer might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/compta/sociales/card.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
Expand Down Expand Up @@ -19593,13 +19587,7 @@ parameters:
-
message: '#^Variable \$begin might not be defined\.$#'
identifier: variable.undefined
count: 5
path: ../../../htdocs/fourn/contact.php

-
message: '#^Variable \$contactname might not be defined\.$#'
identifier: variable.undefined
count: 1
count: 3
path: ../../../htdocs/fourn/contact.php

-
Expand All @@ -19608,12 +19596,6 @@ parameters:
count: 4
path: ../../../htdocs/fourn/contact.php

-
message: '#^Variable \$stcomm might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/fourn/contact.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
Expand Down Expand Up @@ -22290,12 +22272,6 @@ parameters:
count: 2
path: ../../../htdocs/loan/class/loanschedule.class.php

-
message: '#^Negated boolean expression is always true\.$#'
identifier: booleanNot.alwaysTrue
count: 1
path: ../../../htdocs/loan/class/paymentloan.class.php

-
message: '#^Property PaymentLoan\:\:\$amount_capital \(float\|int\) in isset\(\) is not nullable\.$#'
identifier: isset.property
Expand Down Expand Up @@ -32628,21 +32604,9 @@ parameters:
count: 4
path: ../../../htdocs/website/index.php

-
message: '#^Comparison operation "\>\=" between 1 and 0 is always true\.$#'
identifier: greaterOrEqual.alwaysTrue
count: 1
path: ../../../htdocs/website/samples/wrapper.php

-
message: '#^If condition is always false\.$#'
identifier: if.alwaysFalse
count: 3
path: ../../../htdocs/website/samples/wrapper.php

-
message: '#^If condition is always true\.$#'
identifier: if.alwaysTrue
count: 1
path: ../../../htdocs/website/samples/wrapper.php

Expand Down
Loading

0 comments on commit d37897b

Please sign in to comment.