aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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": {