From cc551acaaaadaa56516ce8774afc3f7495e61d85 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 21 Aug 2023 16:14:46 +0200 Subject: [PATCH] fix(CS): Ignore apps*/ directories which are gitignored Signed-off-by: Joas Schilling --- .php-cs-fixer.dist.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index fe6d31065f4..2058f8d0d65 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -21,4 +21,17 @@ $config ->notPath('node_modules') ->notPath('vendor') ->in(__DIR__); + +// 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()); + } + } +} + return $config;