From e2927b19b8342b99fb0d74092d63b1dc7eaa2b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Sat, 4 Jan 2025 18:56:15 +0100 Subject: [PATCH 1/2] chore: Import nextcloud/rector and use it in rector config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- composer.json | 3 +- composer.lock | 66 +++++++++++++++++++++++++++++++++++++++-- rector.php | 31 ++++++------------- tests/OperationTest.php | 12 +++----- 4 files changed, 79 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index fb4a591..6df98cc 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "vimeo/psalm": "^5.9", "sabre/vobject": "^4.5", "rector/rector": "^1.0", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "nextcloud/rector": "^0.2.1" }, "require": { "php": "^8.0.2", diff --git a/composer.lock b/composer.lock index f4c57d6..2152110 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "24d87cc0b356ae2e1a4c738170587a8c", + "content-hash": "05338b20ab5a6b04e01159d7db3aa1ca", "packages": [ { "name": "christophwurst/kitinerary", @@ -1175,6 +1175,68 @@ }, "time": "2024-01-12T00:34:25+00:00" }, + { + "name": "nextcloud/rector", + "version": "v0.2.1", + "source": { + "type": "git", + "url": "https://github.com/nextcloud-libraries/rector.git", + "reference": "d73ab086700564f675eda9a834b6b08410a1da7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud-libraries/rector/zipball/d73ab086700564f675eda9a834b6b08410a1da7e", + "reference": "d73ab086700564f675eda9a834b6b08410a1da7e", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "phpunit/phpunit": "^10.5", + "ramsey/devtools": "^2.0", + "rector/rector": "^1.2" + }, + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/devtools": { + "memory-limit": "-1", + "command-prefix": "dev" + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "autoload": { + "psr-4": { + "Nextcloud\\Rector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at", + "homepage": "https://wuc.me" + } + ], + "description": "Rector upgrade rules for Nextcloud", + "keywords": [ + "nextcloud", + "refactoring" + ], + "support": { + "issues": "https://github.com/nextcloud-libraries/rector/issues", + "source": "https://github.com/nextcloud-libraries/rector/tree/v0.2.1" + }, + "time": "2024-10-01T12:24:08+00:00" + }, { "name": "nikic/php-parser", "version": "v4.19.1", @@ -4451,7 +4513,7 @@ }, "platform-dev": [], "platform-overrides": { - "php": "8.0.2" + "php": "8.1" }, "plugin-api-version": "2.6.0" } diff --git a/rector.php b/rector.php index 8b76ace..00c7142 100644 --- a/rector.php +++ b/rector.php @@ -2,30 +2,17 @@ declare(strict_types=1); -use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector; +use Nextcloud\Rector\Set\NextcloudSets; use Rector\Config\RectorConfig; -use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPromotedPropertyRector; -use Rector\Php54\Rector\Array_\LongArrayToShortArrayRector; -use Rector\Set\ValueObject\LevelSetList; -use Rector\Set\ValueObject\SetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ + __DIR__ . '/appinfo', __DIR__ . '/lib', __DIR__ . '/tests', + ]) + ->withPhpSets(php81: true) + ->withTypeCoverageLevel(1) + ->withSets([ + NextcloudSets::NEXTCLOUD_27, ]); - - // register a single rule - $rectorConfig->rule(RemoveUnusedPromotedPropertyRector::class); - $rectorConfig->rule(SimplifyEmptyCheckOnEmptyArrayRector::class); - $rectorConfig->rule(LongArrayToShortArrayRector::class); - - // define sets of rules - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_80, - // SetList::CODE_QUALITY, - SetList::CODING_STYLE, - SetList::TYPE_DECLARATION, - // SetList::DEAD_CODE, - ]); -}; diff --git a/tests/OperationTest.php b/tests/OperationTest.php index 331695d..df0c1e1 100644 --- a/tests/OperationTest.php +++ b/tests/OperationTest.php @@ -44,15 +44,11 @@ use Psr\Log\LoggerInterface; class OperationTest extends TestCase { - /** @var IL10N&MockObject */ - private IL10N|MockObject $l; - /** @var IManager&MockObject */ - private IManager|MockObject $calendarManager; + private IL10N&MockObject $l; + private IManager&MockObject $calendarManager; private Operation $operation; - /** @var ICreateFromString&MockObject */ - private ICreateFromString|MockObject $calendar; - /** @var FlatpakAdapter&MockObject */ - private FlatpakAdapter|MockObject $flatpakAdapter; + private ICreateFromString&MockObject $calendar; + private FlatpakAdapter&MockObject $flatpakAdapter; protected function setUp(): void { parent::setUp(); From 80de4d1f7f648f2857e2600374b9e17f544609ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Sat, 4 Jan 2025 18:57:19 +0100 Subject: [PATCH 2/2] chore: Release v1.6.0 for Nextcloud 30 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- CHANGELOG.md | 6 ++++++ appinfo/info.xml | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fb3e67..ad247a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.6.0 + +* Bump dependencies +* Support 30 +* Drop 25 and 26 + # v1.5.0 * Bump dependencies diff --git a/appinfo/info.xml b/appinfo/info.xml index 9968ead..2afaabb 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ Automated kitinerary parsing Use kitinerary to parse travel documents into the calendar An app to trigger automatic conversion of travel documents to calendar events. It uses kitinerary to extract the information and is compatible with the KDE itinerary mobile application. - 1.5.0 + 1.6.0 agpl Côme Chilliet WorkflowKitinerary diff --git a/package-lock.json b/package-lock.json index 00d4ce1..891c782 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "workflow_kitinerary", - "version": "1.5.0", + "version": "1.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "workflow_kitinerary", - "version": "1.5.0", + "version": "1.6.0", "license": "agpl", "dependencies": { "@nextcloud/initial-state": "^2.2.0", diff --git a/package.json b/package.json index e728109..687317a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "workflow_kitinerary", "description": "Workflow for using kitinerary to parse travel documents into the calendar", - "version": "1.5.0", + "version": "1.6.0", "author": "Côme Chilliet ", "license": "agpl", "private": true,