Skip to content

Commit

Permalink
More work on branch-specific PHP-CS-Fixer cache files
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 20, 2023
1 parent 5bb4a31 commit 59f3dc2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# PHP-CS-Fixer
/.php-cs-fixer.php
/.php-cs-fixer.cache*
/.php-cs-fixer.cache

# Psalm
/.psalm/cache
Expand Down
6 changes: 1 addition & 5 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,6 @@
'whitespace_after_comma_in_array' => true,
]);

$branch = @trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD'));

if (!empty($branch)) {
$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache.' . $branch);
}
$config->setCacheFile(__DIR__ . '/.php-cs-fixer.cache/' . sha1(@trim((string) @shell_exec('git rev-parse --abbrev-ref HEAD'))));

return $config;

0 comments on commit 59f3dc2

Please sign in to comment.