From 92e3770bfc5ff39c5639118d7a1e4312dbaefb68 Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sat, 7 Feb 2026 20:29:59 +0000 Subject: [PATCH 1/4] CI: use @master ref, add workflow_dispatch, PHP 8.2-8.5 matrix, add coverage workflow, remove .kodiak.toml --- .github/.kodiak.toml | 10 ---------- .github/workflows/codesniffer.yml | 3 ++- .github/workflows/coverage.yml | 18 ++++++++++++++++++ .github/workflows/phpstan.yml | 3 ++- .github/workflows/tests.yml | 31 ++++++++++++++++++++++--------- 5 files changed, 44 insertions(+), 21 deletions(-) delete mode 100644 .github/.kodiak.toml create mode 100644 .github/workflows/coverage.yml diff --git a/.github/.kodiak.toml b/.github/.kodiak.toml deleted file mode 100644 index 60c34b6..0000000 --- a/.github/.kodiak.toml +++ /dev/null @@ -1,10 +0,0 @@ -version = 1 - -[merge] -automerge_label = "automerge" -blacklist_title_regex = "^WIP.*" -blacklist_labels = ["WIP"] -method = "rebase" -delete_branch_on_merge = true -notify_on_conflict = true -optimistic_updates = false diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index 60ccf92..a58ac4f 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -2,6 +2,7 @@ name: "Codesniffer" on: pull_request: + workflow_dispatch: push: branches: ["*"] @@ -12,6 +13,6 @@ on: jobs: codesniffer: name: "Codesniffer" - uses: contributte/.github/.github/workflows/codesniffer.yml@v1 + uses: contributte/.github/.github/workflows/codesniffer.yml@master with: php: "8.2" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..fac01f8 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,18 @@ +name: "Coverage" + +on: + pull_request: + workflow_dispatch: + + push: + branches: ["*"] + + schedule: + - cron: "0 9 * * 1" + +jobs: + coverage: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master + with: + php: "8.2" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 131be8e..eb916bf 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,6 +2,7 @@ name: "Phpstan" on: pull_request: + workflow_dispatch: push: branches: ["*"] @@ -12,6 +13,6 @@ on: jobs: phpstan: name: "Phpstan" - uses: contributte/.github/.github/workflows/phpstan.yml@v1 + uses: contributte/.github/.github/workflows/phpstan.yml@master with: php: "8.2" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9ef1dd..7d85dd5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,29 +2,42 @@ name: "Nette Tester" on: pull_request: + workflow_dispatch: push: - branches: [ "*" ] + branches: ["*"] schedule: - cron: "0 8 * * 1" jobs: - test82: + test85: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + 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" - test81: + test83: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.1" + php: "8.3" + + test82: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester.yml@master + with: + php: "8.2" testlower: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.1" + php: "8.2" composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest" From 602239ffbfcfd3968934be21059d9143ba4760ce Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sat, 7 Feb 2026 20:30:07 +0000 Subject: [PATCH 2/4] Tests: add bootstrap and CustomTasks test --- tests/Cases/CustomTasksTest.phpt | 22 ++++++++++++++++++++++ tests/bootstrap.php | 10 ++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/Cases/CustomTasksTest.phpt create mode 100644 tests/bootstrap.php diff --git a/tests/Cases/CustomTasksTest.phpt b/tests/Cases/CustomTasksTest.phpt new file mode 100644 index 0000000..5e266a0 --- /dev/null +++ b/tests/Cases/CustomTasksTest.phpt @@ -0,0 +1,22 @@ +getMessages()); +}); + +Toolkit::test(static function (): void { + $result = new Result(); + CustomTasks::tabIndentationChecker(" test\n", $result); + Assert::count(1, $result->getMessages()); +}); diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..86c92a0 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,10 @@ + Date: Sat, 7 Feb 2026 20:30:15 +0000 Subject: [PATCH 3/4] Config: use PHP 8.2 base, align with Contributte standards --- .editorconfig | 2 +- .gitattributes | 5 ++--- .gitignore | 8 ++++++++ Makefile | 16 ++++++++++++---- phpstan.neon | 4 +--- ruleset.xml | 2 +- 6 files changed, 25 insertions(+), 12 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3faf149..5e5b915 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,6 @@ indent_style = tab indent_size = tab tab_width = 4 -[{*.json, *.yaml, *.yml, *.md}] +[*.{json,yaml,yml,md}] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes index 12910b6..aad8529 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,11 +1,10 @@ -# 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 +phpstan.neon export-ignore ruleset.xml export-ignore +tests export-ignore diff --git a/.gitignore b/.gitignore index e4b95ba..f0b3670 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,11 @@ # Composer /vendor /composer.lock + +# Tests +/tests/tmp +/coverage.* +/tests/**/*.log +/tests/**/*.html +/tests/**/*.expected +/tests/**/*.actual diff --git a/Makefile b/Makefile index 6da0a9c..33bc117 100644 --- a/Makefile +++ b/Makefile @@ -8,14 +8,14 @@ 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 | 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 + 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 + vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests .PHONY: phpstan phpstan: @@ -23,4 +23,12 @@ phpstan: .PHONY: tests tests: - echo "OK" + 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 +else + vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases +endif diff --git a/phpstan.neon b/phpstan.neon index 562ab05..cd64186 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,7 +3,7 @@ includes: parameters: level: 9 - phpVersion: 80100 + phpVersion: 80200 scanDirectories: - src @@ -14,5 +14,3 @@ parameters: paths: - src - .docs - - ignoreErrors: diff --git a/ruleset.xml b/ruleset.xml index 6d23956..a7920a7 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -1,7 +1,7 @@ - + From 97c208478ed9f37434e2f68c137471988eada821 Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sat, 7 Feb 2026 20:30:23 +0000 Subject: [PATCH 4/4] Composer: require PHP 8.2+, use full version format, add autoload-dev --- composer.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 8e282f3..5a99dd6 100644 --- a/composer.json +++ b/composer.json @@ -16,19 +16,24 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "nette/code-checker": "^3.3.2" }, "require-dev": { - "contributte/qa": "^0.4", - "contributte/tester": "^0.3", - "contributte/phpstan": "^0.1" + "contributte/qa": "~0.4.0", + "contributte/tester": "~0.3.0", + "contributte/phpstan": "~0.2.0" }, "autoload": { "psr-4": { "Contributte\\CodeChecker\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests" + } + }, "bin": [ "bin/checker" ],