Skip to content

Commit

Permalink
Merge branch '2023.11' into 2024.11
Browse files Browse the repository at this point in the history
execute composer:
    composer require --dev squizlabs/php_codesniffer
    composer require --dev digitalrevolution/php-codesniffer-baseline
  • Loading branch information
byteplow committed Jan 25, 2024
2 parents 46ebc16 + 60563eb commit 9b2615e
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 23 deletions.
32 changes: 11 additions & 21 deletions ci/gitlab-ci/test_jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,48 +143,38 @@ phpcs-analysis:
script:
- if test "${CI_PROJECT_NAME}" == "tine20"; then dir=./tine20; else dir=./lib; fi
# # generate baseline
# # localy: php tine20/vendor/bin/phpcs -s --standard=PSR12 --report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml --exclude=PSR1.Classes.ClassDeclaration,Squiz.Classes.ValidClassName,PSR2.Classes.PropertyDeclaration,PSR2.Methods.MethodDeclaration --extensions=php --ignore=vendor,library --basepath=. ./tine20
# # or:
# - >
# php vendor/bin/phpcs -s --standard=PSR12 --report=\\DR\\CodeSnifferBaseline\\Reports\\Baseline --report-file=phpcs.baseline.xml
# --exclude=PSR1.Classes.ClassDeclaration,Squiz.Classes.ValidClassName,PSR2.Classes.PropertyDeclaration,PSR2.Methods.MethodDeclaration
# --extensions=php $dir || true
# --extensions=php --ignore=vendor,library --basepath=. $dir || true
- >
php vendor/bin/phpcs -s --standard=PSR12 --report=full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=${CI_PROJECT_DIR}/phpcs-report.json
--exclude=PSR1.Classes.ClassDeclaration,Squiz.Classes.ValidClassName,PSR2.Classes.PropertyDeclaration,PSR2.Methods.MethodDeclaration
--extensions=php $dir
--extensions=php --ignore=vendor,library,Tinebase/views/autodiscover --basepath=. $dir
artifacts:
reports:
codequality: ${CI_PROJECT_DIR}/phpcs-report.json
# # generate baseline
# paths:
# - phpcs.baseline.xml
allow_failure: true
rules:
- if: $RUN_NO_TESTS == "true"
when: never
- if: $PHPCS_ANALYSIS == "false"
when: never
- if: $PHPCS_ANALYSIS == "true" && $PHPCS_ANALYSIS_STRICT == "true"
allow_failure: false
- if: $PHPCS_ANALYSIS == "true"
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $PHPCS_ANALYSIS_MERGE_REQUEST == "true" && $PHPCS_ANALYSIS_STRICT == "true"
allow_failure: false
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $PHPCS_ANALYSIS_MERGE_REQUEST == "true"
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /phpcs-analysis/ && $PHPCS_ANALYSIS_STRICT == "true"
allow_failure: false
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $PHPCS_ANALYSIS_MERGE_REQUEST != "false"
changes:
paths:
- "**/*.php"
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /phpcs-analysis/
- if: $PIPELINE_TYPE =~ /default-tests/ && $PHPCS_ANALYSIS_STRICT == "true"
allow_failure: false
- if: $PIPELINE_TYPE =~ /default-tests/
when: never
- if: $PIPELINE_TYPE =~ /mr-tests/ && $PHPCS_ANALYSIS_STRICT == "true"
allow_failure: false
- if: $PIPELINE_TYPE =~ /mr-tests/
when: never
- if: $CI_COMMIT_TAG && $PHPCS_ANALYSIS_STRICT == "true"
allow_failure: false
- if: $CI_COMMIT_TAG
when: never
timeout: 30m
- if: $CI_COMMIT_TAG
allow_failure: true
timeout: 20m
interruptible: true

test-with-health-check:
Expand Down
5 changes: 4 additions & 1 deletion tine20/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@
"zendframework/zendframework1": "1.12.20.*"
},
"require-dev": {
"digitalrevolution/php-codesniffer-baseline": "^1.1",
"laminas/laminas-psr7bridge": "^1",
"phing/phing": "2.16.*",
"phpstan/phpstan": "^1.6",
"phpunit/phpunit": "^8.5",
"squizlabs/php_codesniffer": "^3.8",
"tedivm/jshrink": "~1.0"
},
"autoload": {
Expand Down Expand Up @@ -182,7 +184,8 @@
"sort-packages": true,
"allow-plugins": {
"tine20/composerapploader": true,
"simplesamlphp/composer-module-installer": true
"simplesamlphp/composer-module-installer": true,
"digitalrevolution/php-codesniffer-baseline": true
}
},
"scripts": {
Expand Down
133 changes: 132 additions & 1 deletion tine20/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b2615e

Please sign in to comment.