Merge pull request #31206 from woocommerce/fix/changelogger-validate

Jetpack Changelogger: Validate entries
This commit is contained in:
Claudio Sanches 2021-11-26 13:21:01 -03:00 committed by GitHub
commit bc910e2364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 57 deletions

View File

@ -12,15 +12,15 @@
"formatter": {
"filename": "../../../tools/changelogger/PackageFormatter.php"
},
"types": [
"Fix",
"Add",
"Update",
"Dev",
"Tweak",
"Performance",
"Enhancement"
],
"types": {
"fix": "Fixes an existing bug",
"add": "Adds functionality",
"update": "Update existing functionality",
"dev": "Development related task",
"tweak": "A minor adjustment to the codebase",
"performance": "Address performance issues",
"enhancement": "Improve existing functionality"
},
"changelog": "NEXT_CHANGELOG.md"
}
}

View File

@ -12,15 +12,15 @@
"formatter": {
"filename": "../../../tools/changelogger/PackageFormatter.php"
},
"types": [
"Fix",
"Add",
"Update",
"Dev",
"Tweak",
"Performance",
"Enhancement"
],
"types": {
"fix": "Fixes an existing bug",
"add": "Adds functionality",
"update": "Update existing functionality",
"dev": "Development related task",
"tweak": "A minor adjustment to the codebase",
"performance": "Address performance issues",
"enhancement": "Improve existing functionality"
},
"changelog": "NEXT_CHANGELOG.md"
}
}

View File

@ -12,15 +12,15 @@
"formatter": {
"filename": "../../../tools/changelogger/PackageFormatter.php"
},
"types": [
"Fix",
"Add",
"Update",
"Dev",
"Tweak",
"Performance",
"Enhancement"
],
"types": {
"fix": "Fixes an existing bug",
"add": "Adds functionality",
"update": "Update existing functionality",
"dev": "Development related task",
"tweak": "A minor adjustment to the codebase",
"performance": "Address performance issues",
"enhancement": "Improve existing functionality"
},
"changelog": "NEXT_CHANGELOG.md"
}
}

View File

@ -12,15 +12,15 @@
"formatter": {
"filename": "../../../tools/changelogger/PackageFormatter.php"
},
"types": [
"Fix",
"Add",
"Update",
"Dev",
"Tweak",
"Performance",
"Enhancement"
],
"types": {
"fix": "Fixes an existing bug",
"add": "Adds functionality",
"update": "Update existing functionality",
"dev": "Development related task",
"tweak": "A minor adjustment to the codebase",
"performance": "Address performance issues",
"enhancement": "Improve existing functionality"
},
"changelog": "NEXT_CHANGELOG.md"
}
}

View File

@ -12,15 +12,15 @@
"formatter": {
"filename": "../../../tools/changelogger/PackageFormatter.php"
},
"types": [
"Fix",
"Add",
"Update",
"Dev",
"Tweak",
"Performance",
"Enhancement"
],
"types": {
"fix": "Fixes an existing bug",
"add": "Adds functionality",
"update": "Update existing functionality",
"dev": "Development related task",
"tweak": "A minor adjustment to the codebase",
"performance": "Address performance issues",
"enhancement": "Improve existing functionality"
},
"changelog": "NEXT_CHANGELOG.md"
}
}

View File

@ -39,7 +39,7 @@
"sort-packages": true,
"platform": {
"php": "7.0.33"
}
}
},
"autoload": {
"exclude-from-classmap": [
@ -122,15 +122,15 @@
"formatter": {
"filename": "../../tools/changelogger/PluginFormatter.php"
},
"types": [
"Fix",
"Add",
"Update",
"Dev",
"Tweak",
"Performance",
"Enhancement"
],
"types": {
"fix": "Fixes an existing bug",
"add": "Adds functionality",
"update": "Update existing functionality",
"dev": "Development related task",
"tweak": "A minor adjustment to the codebase",
"performance": "Address performance issues",
"enhancement": "Improve existing functionality"
},
"versioning": "wordpress",
"changelog": "NEXT_CHANGELOG.md"
}

View File

@ -256,10 +256,11 @@ class Formatter extends KeepAChangelogParser {
foreach ( $entry->getChangesBySubheading() as $heading => $changes ) {
foreach ( $changes as $change ) {
$breaking_change = 'major' === $change->getSignificance() ? ' [ **BREAKING CHANGE** ]' : '';
$significance = $change->getSignificance();
$breaking_change = 'major' === $significance ? ' [ **BREAKING CHANGE** ]' : '';
$text = trim( $change->getContent() );
if ( '' !== $text ) {
$preamble = $is_subentry ? '' : $bullet . $heading . $breaking_change . ' - ';
$preamble = $is_subentry ? '' : $bullet . ucfirst( $significance ) . $breaking_change . ' - ';
$ret .= $preamble . str_replace( "\n", "\n$indent", $text ) . "\n";
}
}