From 87b896406a2bc8975f9c07477d7911a6ba481614 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 14:01:14 +0000 Subject: [PATCH 1/3] Upgrade library to match contributte specification - Add autoload-dev section for tests namespace in composer.json - Update Makefile format with separate .PHONY declarations - Modernize .editorconfig with separate rules for yml, md, and neon files - Update .gitattributes to include .github directory export-ignore - Clean up .gitignore with proper paths for vendor, tests/tmp - Add lowest dependency test job in tests.yml workflow - Update phpstan.yml, codesniffer.yml, coverage.yml to PHP 8.4 - Add secrets inherit to coverage workflow - Rename tests/cases to tests/Cases for consistency - Update README versions table for PHP 8.2+ requirement --- .editorconfig | 14 +++++--- .gitattributes | 20 +++++------ .github/workflows/codesniffer.yml | 5 +-- .github/workflows/coverage.yml | 6 ++-- .github/workflows/phpstan.yml | 5 +-- .github/workflows/tests.yml | 34 ++++++++++++------- .gitignore | 15 +++----- Makefile | 21 +++++++----- README.md | 9 +++-- composer.json | 5 +++ tests/{cases => Cases}/Client/FakeClient.phpt | 0 tests/{cases => Cases}/Client/Request.phpt | 0 tests/{cases => Cases}/Client/Response.phpt | 0 tests/{cases => Cases}/Curl/CurlBuilder.phpt | 0 .../DI/BasicAuthExtension.phpt | 0 tests/{cases => Cases}/DI/CurlExtension.phpt | 0 .../DI/SapiRequestExtension.phpt | 0 tests/{cases => Cases}/Url.phpt | 0 18 files changed, 76 insertions(+), 58 deletions(-) rename tests/{cases => Cases}/Client/FakeClient.phpt (100%) rename tests/{cases => Cases}/Client/Request.phpt (100%) rename tests/{cases => Cases}/Client/Response.phpt (100%) rename tests/{cases => Cases}/Curl/CurlBuilder.phpt (100%) rename tests/{cases => Cases}/DI/BasicAuthExtension.phpt (100%) rename tests/{cases => Cases}/DI/CurlExtension.phpt (100%) rename tests/{cases => Cases}/DI/SapiRequestExtension.phpt (100%) rename tests/{cases => Cases}/Url.phpt (100%) diff --git a/.editorconfig b/.editorconfig index 3faf149..81fb492 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,3 @@ -# EditorConfig is awesome: http://EditorConfig.org - root = true [*] @@ -8,9 +6,15 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = tab -indent_size = tab -tab_width = 4 +indent_size = 4 -[{*.json, *.yaml, *.yml, *.md}] +[*.{yml,yaml}] indent_style = space indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +[*.neon] +indent_style = tab +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index 12910b6..ab3bf9a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,9 @@ -# Not archived -.docs export-ignore -tests export-ignore -.editorconfig export-ignore -.gitattributes export-ignore -.gitignore export-ignore -.travis.yml export-ignore -Makefile export-ignore -phpstan.neon export-ignore -README.md export-ignore -ruleset.xml export-ignore +/.docs export-ignore +/.github export-ignore +/tests export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +Makefile export-ignore +phpstan.neon export-ignore +ruleset.xml export-ignore diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index d5ff803..b7ef92b 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -5,7 +5,8 @@ on: workflow_dispatch: push: - branches: ["*"] + branches: + - "**" schedule: - cron: "0 8 * * 1" @@ -15,4 +16,4 @@ jobs: name: "Codesniffer" uses: contributte/.github/.github/workflows/codesniffer.yml@master with: - php: "8.3" + php: "8.4" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 85f1300..2f93b56 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -5,7 +5,8 @@ on: workflow_dispatch: push: - branches: ["*"] + branches: + - "**" schedule: - cron: "0 8 * * 1" @@ -15,4 +16,5 @@ jobs: name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master with: - php: "8.3" + php: "8.4" + secrets: inherit diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9827fdd..9546a11 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -5,7 +5,8 @@ on: workflow_dispatch: push: - branches: ["*"] + branches: + - "**" schedule: - cron: "0 8 * * 1" @@ -15,4 +16,4 @@ jobs: name: "Phpstan" uses: contributte/.github/.github/workflows/phpstan.yml@master with: - php: "8.3" + php: "8.4" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e4b0ffb..f18c37f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,36 +1,44 @@ -name: "Tests" +name: "Nette Tester" on: pull_request: workflow_dispatch: push: - branches: ["*"] + branches: + - "**" schedule: - cron: "0 8 * * 1" jobs: - tests-82: - name: "Nette Tester (PHP 8.2)" + test85: + name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.2" + php: "8.5" + + test84: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester.yml@master + with: + php: "8.4" - tests-83: - name: "Nette Tester (PHP 8.3)" + test83: + name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester.yml@master with: php: "8.3" - tests-84: - name: "Nette Tester (PHP 8.4)" + test82: + name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.4" + php: "8.2" - tests-85: - name: "Nette Tester (PHP 8.5)" + testlowest: + name: "Nette Tester Lowest" uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.5" + php: "8.2" + composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-lowest --prefer-stable" diff --git a/.gitignore b/.gitignore index b1b6f4d..d761748 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,5 @@ -# IDE -/.idea - -# Composer -/vendor -/composer.lock - -# Tests -/temp -/coverage.xml +/vendor/ +/tests/tmp/ +composer.lock +coverage.html +coverage.xml diff --git a/Makefile b/Makefile index 8f5528e..6655ff5 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,34 @@ -.PHONY: install qa cs csf phpstan tests coverage - +.PHONY: install install: composer update +.PHONY: qa qa: phpstan cs +.PHONY: cs cs: ifdef GITHUB_ACTION - vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr + vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions=php,phpt --colors -nsp -q --report=checkstyle src tests | cs2pr else - vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests + vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions=php,phpt --colors -nsp src tests endif +.PHONY: csf csf: - vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests + vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions=php,phpt --colors -nsp src tests +.PHONY: phpstan phpstan: vendor/bin/phpstan analyse -c phpstan.neon +.PHONY: tests tests: - vendor/bin/tester -s -p php --colors 1 -C tests/cases + vendor/bin/tester -s -p php --colors 1 -C tests/Cases +.PHONY: coverage coverage: ifdef GITHUB_ACTION - vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases + vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases else - vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.html --coverage-src ./src tests/cases + vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases endif diff --git a/README.md b/README.md index 88304f3..6084b03 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,10 @@ For details on how to use this package, check out our [documentation](.docs). ## Versions -| State | Version | Branch | Nette | PHP | -|-------------|---------|----------|-------|---------| -| dev | `^0.5` | `master` | 3.0+ | `>=7.2` | -| stable | `^0.4` | `master` | 3.0+ | `>=7.2` | -| stable | `^0.2` | `master` | 2.4 | `>=7.1` | +| State | Version | Branch | Nette | PHP | +|--------|---------|----------|-------|---------| +| dev | `^0.6` | `master` | 3.2+ | `>=8.2` | +| stable | `^0.5` | `master` | 3.0+ | `>=7.2` | ## Development diff --git a/composer.json b/composer.json index c0e8333..3598c2e 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,11 @@ "Contributte\\Http\\": "src" } }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests" + } + }, "minimum-stability": "dev", "prefer-stable": true, "config": { diff --git a/tests/cases/Client/FakeClient.phpt b/tests/Cases/Client/FakeClient.phpt similarity index 100% rename from tests/cases/Client/FakeClient.phpt rename to tests/Cases/Client/FakeClient.phpt diff --git a/tests/cases/Client/Request.phpt b/tests/Cases/Client/Request.phpt similarity index 100% rename from tests/cases/Client/Request.phpt rename to tests/Cases/Client/Request.phpt diff --git a/tests/cases/Client/Response.phpt b/tests/Cases/Client/Response.phpt similarity index 100% rename from tests/cases/Client/Response.phpt rename to tests/Cases/Client/Response.phpt diff --git a/tests/cases/Curl/CurlBuilder.phpt b/tests/Cases/Curl/CurlBuilder.phpt similarity index 100% rename from tests/cases/Curl/CurlBuilder.phpt rename to tests/Cases/Curl/CurlBuilder.phpt diff --git a/tests/cases/DI/BasicAuthExtension.phpt b/tests/Cases/DI/BasicAuthExtension.phpt similarity index 100% rename from tests/cases/DI/BasicAuthExtension.phpt rename to tests/Cases/DI/BasicAuthExtension.phpt diff --git a/tests/cases/DI/CurlExtension.phpt b/tests/Cases/DI/CurlExtension.phpt similarity index 100% rename from tests/cases/DI/CurlExtension.phpt rename to tests/Cases/DI/CurlExtension.phpt diff --git a/tests/cases/DI/SapiRequestExtension.phpt b/tests/Cases/DI/SapiRequestExtension.phpt similarity index 100% rename from tests/cases/DI/SapiRequestExtension.phpt rename to tests/Cases/DI/SapiRequestExtension.phpt diff --git a/tests/cases/Url.phpt b/tests/Cases/Url.phpt similarity index 100% rename from tests/cases/Url.phpt rename to tests/Cases/Url.phpt From efae955408ab75efce1426927df489c2f4e352ff Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 22 Dec 2025 17:07:50 +0000 Subject: [PATCH 2/3] Update workflows to match spec format - Change branches format from list to inline array ["*"] - Stagger cron schedules: tests 8:00, phpstan 9:00, codesniffer 10:00, coverage 11:00 UTC --- .github/workflows/codesniffer.yml | 5 ++--- .github/workflows/coverage.yml | 5 ++--- .github/workflows/phpstan.yml | 5 ++--- .github/workflows/tests.yml | 3 +-- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index b7ef92b..d1603b1 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -5,11 +5,10 @@ on: workflow_dispatch: push: - branches: - - "**" + branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 10 * * 1" jobs: codesniffer: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2f93b56..67ac359 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -5,11 +5,10 @@ on: workflow_dispatch: push: - branches: - - "**" + branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 11 * * 1" jobs: coverage: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 9546a11..718642f 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -5,11 +5,10 @@ on: workflow_dispatch: push: - branches: - - "**" + branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 9 * * 1" jobs: phpstan: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f18c37f..379cbac 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,8 +5,7 @@ on: workflow_dispatch: push: - branches: - - "**" + branches: ["*"] schedule: - cron: "0 8 * * 1" From 9afb965c72d333139799fc8d9ac0523b4083d55f Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 25 Dec 2025 17:48:02 +0000 Subject: [PATCH 3/3] Align repository with barekit-library template - Update .editorconfig to use unified file pattern format - Extend .gitignore with test artifact patterns (log, html, expected, actual) - Align workflow cron schedules with template: - tests: 10:00 UTC - phpstan: 10:00 UTC - codesniffer: 08:00 UTC - coverage: 09:00 UTC --- .editorconfig | 12 +++--------- .github/workflows/codesniffer.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/phpstan.yml | 2 +- .github/workflows/tests.yml | 2 +- .gitignore | 19 ++++++++++++++----- 6 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.editorconfig b/.editorconfig index 81fb492..352f1e9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,15 +6,9 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true indent_style = tab -indent_size = 4 +indent_size = tab +tab_width = 4 -[*.{yml,yaml}] +[*.{json,yaml,yml,md}] indent_style = space indent_size = 2 - -[*.md] -trim_trailing_whitespace = false - -[*.neon] -indent_style = tab -indent_size = 4 diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index d1603b1..590394f 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -8,7 +8,7 @@ on: branches: ["*"] schedule: - - cron: "0 10 * * 1" + - cron: "0 8 * * 1" jobs: codesniffer: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 67ac359..75a3f89 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -8,7 +8,7 @@ on: branches: ["*"] schedule: - - cron: "0 11 * * 1" + - cron: "0 9 * * 1" jobs: coverage: diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 718642f..cd37eba 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -8,7 +8,7 @@ on: branches: ["*"] schedule: - - cron: "0 9 * * 1" + - cron: "0 10 * * 1" jobs: phpstan: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 379cbac..909d734 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ on: branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 10 * * 1" jobs: test85: diff --git a/.gitignore b/.gitignore index d761748..f0b3670 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ -/vendor/ -/tests/tmp/ -composer.lock -coverage.html -coverage.xml +# IDE +/.idea + +# Composer +/vendor +/composer.lock + +# Tests +/tests/tmp +/coverage.* +/tests/**/*.log +/tests/**/*.html +/tests/**/*.expected +/tests/**/*.actual