Skip to content

Commit 45851bf

Browse files
turegjorupclaude
andcommitted
fix(mate): exclude auto-managed mate/extensions.php from php-cs-fixer
mate/extensions.php is regenerated by `mate discover` (per its header), so php-cs-fixer must not rewrite it — the declare(strict_types) it had added would be clobbered on the next discover and re-flagged on the next run. Exclude it via the Finder and restore the generated form. mate/config.php is the user's own service config (not auto-managed) and stays formatted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8f692f9 commit 45851bf

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

.php-cs-fixer.dist.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
3+
declare(strict_types=1);
24
// This file is copied from config/symfony/php/.php-cs-fixer.dist.php in https://github.com/itk-dev/devops_itkdev-docker.
35
// Feel free to edit the file, but consider making a pull request if you find a general issue with the file.
46

@@ -12,6 +14,10 @@
1214
$finder->in(__DIR__);
1315
// … that are not ignored by VCS
1416
$finder->ignoreVCSIgnored(true);
17+
// mate/extensions.php is regenerated by `mate discover` (see its header), so
18+
// excluding it keeps php-cs-fixer from fighting the auto-managed form (e.g.
19+
// re-adding declare(strict_types) that the generator omits).
20+
$finder->notPath('mate/extensions.php');
1521

1622
$config = new PhpCsFixer\Config();
1723
$config->setFinder($finder);

mate/extensions.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
// This file is managed by 'mate discover'
64
// You can manually edit to enable/disable extensions
75

0 commit comments

Comments
 (0)