aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-09-23 11:58:27 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-09-23 11:58:27 +0200
commit98efa3bda838065fb9ff5740f2688fe2b526ae2d (patch)
tree2be6e53b611eff4aa05fcdc2ee35512b6d2028b4
parentf9f95cf66de4eedd0a99463b9e14b1d1cf1716f0 (diff)
downloadnextcloud-server-feat/add-rector-config.tar.gz
nextcloud-server-feat/add-rector-config.zip
chore(rector): Move rector.php into the build folderfeat/add-rector-config
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r--build/rector.php (renamed from rector.php)28
-rw-r--r--composer.json2
2 files changed, 16 insertions, 14 deletions
diff --git a/rector.php b/build/rector.php
index 3da647afd43..ed8b748663e 100644
--- a/rector.php
+++ b/build/rector.php
@@ -9,29 +9,31 @@ declare(strict_types=1);
use Rector\Config\RectorConfig;
+$nextcloudDir = dirname(__DIR__);
+
$config = RectorConfig::configure()
->withPaths([
- __DIR__ . '/apps',
- // __DIR__ . '/config',
- // __DIR__ . '/core',
- // __DIR__ . '/lib',
- // __DIR__ . '/ocs',
- // __DIR__ . '/ocs-provider',
- // __DIR__ . '/tests',
- // __DIR__ . '/themes',
+ $nextcloudDir . '/apps',
+ // $nextcloudDir . '/config',
+ // $nextcloudDir . '/core',
+ // $nextcloudDir . '/lib',
+ // $nextcloudDir . '/ocs',
+ // $nextcloudDir . '/ocs-provider',
+ // $nextcloudDir . '/tests',
+ // $nextcloudDir . '/themes',
])
->withSkip([
- __DIR__ . '/apps/*/3rdparty/*',
- __DIR__ . '/apps/*/build/stubs/*',
- __DIR__ . '/apps/*/composer/*',
- __DIR__ . '/apps/*/config/*',
+ $nextcloudDir . '/apps/*/3rdparty/*',
+ $nextcloudDir . '/apps/*/build/stubs/*',
+ $nextcloudDir . '/apps/*/composer/*',
+ $nextcloudDir . '/apps/*/config/*',
])
// uncomment to reach your current PHP version
// ->withPhpSets()
->withTypeCoverageLevel(0);
-$ignoredEntries = shell_exec('git status --porcelain --ignored ' . escapeshellarg(__DIR__));
+$ignoredEntries = shell_exec('git status --porcelain --ignored ' . escapeshellarg($nextcloudDir));
$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);
diff --git a/composer.json b/composer.json
index 5eedfd0cf79..d54807e9c8e 100644
--- a/composer.json
+++ b/composer.json
@@ -68,7 +68,7 @@
"test": "phpunit --configuration tests/phpunit-autotest.xml",
"test:db": "@composer run test -- --group DB,SLOWDB",
"test:files_external": "phpunit --configuration tests/phpunit-autotest-external.xml",
- "rector": "rector && composer cs:fix"
+ "rector": "rector --config=build/rector.php && composer cs:fix"
},
"extra": {
"bamarni-bin": {