Skip to content

Commit

Permalink
fix(robo): line formatting for changelog
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 30, 2020
1 parent b624838 commit 9ccd556
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ public function buildFaData() {
}
}

public function buildLog($a, $b) {
public function buildLog($a, $b = 'HEAD') {
$log = ConventionalChangelog::buildLog($a, $b);
echo implode(PHP_EOL, $log);
}
Expand Down Expand Up @@ -794,9 +794,9 @@ public static function filterCommits($commits) {
'build', 'chore', 'ci', 'docs', 'fix', 'feat', 'perf', 'refactor', 'style', 'test'
];
$types = implode('|', $types);
$scope = "(\([^\)]*\))?";
$scope = "(\((?P<scope>[^\)]*)\))?";
$subject = ".*";
$filter = "/^(?P<type>$types)(?P<scope>$scope):(?P<subject>$subject)$/";
$filter = "/^(?P<type>$types)$scope:(?P<subject>$subject)$/";
$filtered = [];
$matches = null;
foreach ($commits as $commit) {
Expand Down Expand Up @@ -879,10 +879,13 @@ public static function buildLog($a, $b = 'HEAD') {
});

$log = [];
if ($b === '"Unreleaased') {
if ($b === 'HEAD') {
array_unshift($tags, $b);
}
$startRef = array_shift($tags);
if ($startRef === null) {
throw new RuntimeException("$a not found");
}
while ($endRef = array_shift($tags)) {
$log = array_merge($log, self::buildLogOneBump($startRef, $endRef));
$startRef = $endRef;
Expand Down

0 comments on commit 9ccd556

Please sign in to comment.