Skip to content

Commit 516667a

Browse files
authored
Improve the changelog test (#1595)
This avoids requiring a changelog entry when changing scaffolding files as those only impact contributors (who can read the git history if they care about them) rather than users of the package.
1 parent 66212b1 commit 516667a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/Unit/ChangelogTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,19 @@ static function ($branch) {
225225
} else {
226226
continue;
227227
}
228+
229+
$subPath = substr($file, \strlen($base));
230+
$normalizedSubPath = str_replace(\DIRECTORY_SEPARATOR, '/', $subPath);
231+
232+
if (\in_array($normalizedSubPath, ['/README.md', '/Makefile', '/.gitattributes', '/.gitignore', '/LICENSE', '/phpunit.xml.dist', '/roave-bc-check.yaml'], true) || str_starts_with($normalizedSubPath, '/.github/') || str_starts_with($normalizedSubPath, '/tests/')) {
233+
// Scaffolding files don't require a changelog entry when modified as they don't impact the usage of the packages
234+
continue;
235+
}
236+
228237
if (!isset($changedServices[$service])) {
229238
$changedServices[$service] = ['base' => $base, 'files' => []];
230239
}
231-
$changedServices[$service]['files'][] = substr($file, \strlen($base));
240+
$changedServices[$service]['files'][] = $subPath;
232241
}
233242

234243
foreach ($changedServices as $service => $changesService) {

0 commit comments

Comments
 (0)