Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore(rector): Move rector.php into the build folder
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Sep 23, 2024
commit 98efa3bda838065fb9ff5740f2688fe2b526ae2d
28 changes: 15 additions & 13 deletions rector.php → build/rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,31 @@

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);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down