2020-03-27 18:54:07 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2024-05-10 16:09:14 +03:00
|
|
|
/**
|
|
|
|
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
*/
|
2022-01-06 16:19:06 +03:00
|
|
|
require_once './vendor-bin/cs-fixer/vendor/autoload.php';
|
2020-03-27 18:54:07 +03:00
|
|
|
|
|
|
|
use Nextcloud\CodingStandard\Config;
|
2024-06-24 11:40:15 +03:00
|
|
|
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
|
2020-03-27 18:54:07 +03:00
|
|
|
|
|
|
|
$config = new Config();
|
|
|
|
$config
|
2024-06-24 11:40:15 +03:00
|
|
|
->setParallelConfig(ParallelConfigFactory::detect())
|
2020-03-27 18:54:07 +03:00
|
|
|
->getFinder()
|
2022-01-06 16:19:06 +03:00
|
|
|
->ignoreVCSIgnored(true)
|
2020-03-27 18:54:07 +03:00
|
|
|
->exclude('config')
|
|
|
|
->exclude('data')
|
|
|
|
->notPath('3rdparty')
|
2021-03-31 11:09:18 +03:00
|
|
|
->notPath('build/integration/vendor')
|
|
|
|
->notPath('build/lib')
|
|
|
|
->notPath('build/node_modules')
|
2020-07-15 23:38:09 +03:00
|
|
|
->notPath('build/stubs')
|
2020-03-27 18:54:07 +03:00
|
|
|
->notPath('composer')
|
2021-01-12 12:15:48 +03:00
|
|
|
->notPath('node_modules')
|
2020-03-27 18:54:07 +03:00
|
|
|
->notPath('vendor')
|
2023-11-23 12:22:52 +03:00
|
|
|
->in('apps')
|
2020-03-27 18:54:07 +03:00
|
|
|
->in(__DIR__);
|
2023-08-21 17:14:46 +03:00
|
|
|
|
|
|
|
// Ignore additional app directories
|
|
|
|
$rootDir = new \DirectoryIterator(__DIR__);
|
|
|
|
foreach ($rootDir as $node) {
|
|
|
|
if (str_starts_with($node->getFilename(), 'apps')) {
|
|
|
|
$return = shell_exec('git check-ignore ' . escapeshellarg($node->getFilename() . '/'));
|
|
|
|
|
|
|
|
if ($return !== null) {
|
|
|
|
$config->getFinder()->exclude($node->getFilename());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-27 18:54:07 +03:00
|
|
|
return $config;
|