chore: Add empty rector configuration

Only applying on apps for now, and only minimal type coverage level.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/48223/head
Côme Chilliet 2 months ago
parent bc5222726b
commit 6db9cbfdeb
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 48
      rector.php
  2. 6
      vendor-bin/rector/composer.json
  3. 198
      vendor-bin/rector/composer.lock

@ -0,0 +1,48 @@
<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-only
*/
use Rector\Config\RectorConfig;
$config = RectorConfig::configure()
->withPaths([
__DIR__ . '/apps',
// __DIR__ . '/config',
// __DIR__ . '/core',
// __DIR__ . '/lib',
// __DIR__ . '/ocs',
// __DIR__ . '/ocs-provider',
// __DIR__ . '/tests',
// __DIR__ . '/themes',
])
->withSkip([
__DIR__ . '/apps/*/3rdparty/*',
__DIR__ . '/apps/*/build/stubs/*',
__DIR__ . '/apps/*/composer/*',
__DIR__ . '/apps/*/config/*',
])
// uncomment to reach your current PHP version
// ->withPhpSets()
->withTypeCoverageLevel(0);
$ignoredEntries = shell_exec('git status --porcelain --ignored ' . escapeshellarg(__DIR__));
$ignoredEntries = explode("\n", $ignoredEntries);
$ignoredEntries = array_filter($ignoredEntries, static fn (string $line) => str_starts_with($line, '!! '));
$ignoredEntries = array_map(static fn (string $line) => substr($line, 3), $ignoredEntries);
$ignoredEntries = array_values($ignoredEntries);
foreach ($ignoredEntries as $ignoredEntry) {
if (str_ends_with($ignoredEntry, '/')) {
$config->withSkip([$ignoredEntry . '*']);
} else {
$config->withSkip([$ignoredEntry . '/*']);
}
}
return $config;

@ -0,0 +1,6 @@
{
"require-dev": {
"rector/rector": "^1.2",
"nextcloud/rector": "^0.2.0"
}
}

@ -0,0 +1,198 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "10939f70efcd3b6d290ecf8f7e9d9da0",
"packages": [],
"packages-dev": [
{
"name": "nextcloud/rector",
"version": "v0.2.0",
"source": {
"type": "git",
"url": "https://github.com/nextcloud-libraries/rector.git",
"reference": "c5cceb7faf2d4df61fe1fd8f82e19c7b106dbe00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nextcloud-libraries/rector/zipball/c5cceb7faf2d4df61fe1fd8f82e19c7b106dbe00",
"reference": "c5cceb7faf2d4df61fe1fd8f82e19c7b106dbe00",
"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/conventional-commits": {
"configFile": "conventional-commits.json"
},
"ramsey/devtools": {
"command-prefix": "dev",
"memory-limit": "-1"
}
},
"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.0"
},
"time": "2024-09-19T09:54:28+00:00"
},
{
"name": "phpstan/phpstan",
"version": "1.12.4",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "ffa517cb918591b93acc9b95c0bebdcd0e4538bd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ffa517cb918591b93acc9b95c0bebdcd0e4538bd",
"reference": "ffa517cb918591b93acc9b95c0bebdcd0e4538bd",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
}
],
"time": "2024-09-19T07:58:01+00:00"
},
{
"name": "rector/rector",
"version": "1.2.5",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "e98aa793ca3fcd17e893cfaf9103ac049775d339"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/e98aa793ca3fcd17e893cfaf9103ac049775d339",
"reference": "e98aa793ca3fcd17e893cfaf9103ac049775d339",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0",
"phpstan/phpstan": "^1.12.2"
},
"conflict": {
"rector/rector-doctrine": "*",
"rector/rector-downgrade-php": "*",
"rector/rector-phpunit": "*",
"rector/rector-symfony": "*"
},
"suggest": {
"ext-dom": "To manipulate phpunit.xml via the custom-rule command"
},
"bin": [
"bin/rector"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Instant Upgrade and Automated Refactoring of any PHP code",
"keywords": [
"automation",
"dev",
"migration",
"refactoring"
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/1.2.5"
},
"funding": [
{
"url": "https://github.com/tomasvotruba",
"type": "github"
}
],
"time": "2024-09-08T17:43:24+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.6.0"
}
Loading…
Cancel
Save