Merge pull request #31206 from woocommerce/fix/changelogger-validate
Jetpack Changelogger: Validate entries
This commit is contained in:
commit
bc910e2364
|
@ -12,15 +12,15 @@
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
||||||
},
|
},
|
||||||
"types": [
|
"types": {
|
||||||
"Fix",
|
"fix": "Fixes an existing bug",
|
||||||
"Add",
|
"add": "Adds functionality",
|
||||||
"Update",
|
"update": "Update existing functionality",
|
||||||
"Dev",
|
"dev": "Development related task",
|
||||||
"Tweak",
|
"tweak": "A minor adjustment to the codebase",
|
||||||
"Performance",
|
"performance": "Address performance issues",
|
||||||
"Enhancement"
|
"enhancement": "Improve existing functionality"
|
||||||
],
|
},
|
||||||
"changelog": "NEXT_CHANGELOG.md"
|
"changelog": "NEXT_CHANGELOG.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
||||||
},
|
},
|
||||||
"types": [
|
"types": {
|
||||||
"Fix",
|
"fix": "Fixes an existing bug",
|
||||||
"Add",
|
"add": "Adds functionality",
|
||||||
"Update",
|
"update": "Update existing functionality",
|
||||||
"Dev",
|
"dev": "Development related task",
|
||||||
"Tweak",
|
"tweak": "A minor adjustment to the codebase",
|
||||||
"Performance",
|
"performance": "Address performance issues",
|
||||||
"Enhancement"
|
"enhancement": "Improve existing functionality"
|
||||||
],
|
},
|
||||||
"changelog": "NEXT_CHANGELOG.md"
|
"changelog": "NEXT_CHANGELOG.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
||||||
},
|
},
|
||||||
"types": [
|
"types": {
|
||||||
"Fix",
|
"fix": "Fixes an existing bug",
|
||||||
"Add",
|
"add": "Adds functionality",
|
||||||
"Update",
|
"update": "Update existing functionality",
|
||||||
"Dev",
|
"dev": "Development related task",
|
||||||
"Tweak",
|
"tweak": "A minor adjustment to the codebase",
|
||||||
"Performance",
|
"performance": "Address performance issues",
|
||||||
"Enhancement"
|
"enhancement": "Improve existing functionality"
|
||||||
],
|
},
|
||||||
"changelog": "NEXT_CHANGELOG.md"
|
"changelog": "NEXT_CHANGELOG.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
||||||
},
|
},
|
||||||
"types": [
|
"types": {
|
||||||
"Fix",
|
"fix": "Fixes an existing bug",
|
||||||
"Add",
|
"add": "Adds functionality",
|
||||||
"Update",
|
"update": "Update existing functionality",
|
||||||
"Dev",
|
"dev": "Development related task",
|
||||||
"Tweak",
|
"tweak": "A minor adjustment to the codebase",
|
||||||
"Performance",
|
"performance": "Address performance issues",
|
||||||
"Enhancement"
|
"enhancement": "Improve existing functionality"
|
||||||
],
|
},
|
||||||
"changelog": "NEXT_CHANGELOG.md"
|
"changelog": "NEXT_CHANGELOG.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,15 +12,15 @@
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
"filename": "../../../tools/changelogger/PackageFormatter.php"
|
||||||
},
|
},
|
||||||
"types": [
|
"types": {
|
||||||
"Fix",
|
"fix": "Fixes an existing bug",
|
||||||
"Add",
|
"add": "Adds functionality",
|
||||||
"Update",
|
"update": "Update existing functionality",
|
||||||
"Dev",
|
"dev": "Development related task",
|
||||||
"Tweak",
|
"tweak": "A minor adjustment to the codebase",
|
||||||
"Performance",
|
"performance": "Address performance issues",
|
||||||
"Enhancement"
|
"enhancement": "Improve existing functionality"
|
||||||
],
|
},
|
||||||
"changelog": "NEXT_CHANGELOG.md"
|
"changelog": "NEXT_CHANGELOG.md"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
"sort-packages": true,
|
"sort-packages": true,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "7.0.33"
|
"php": "7.0.33"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
|
@ -122,15 +122,15 @@
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"filename": "../../tools/changelogger/PluginFormatter.php"
|
"filename": "../../tools/changelogger/PluginFormatter.php"
|
||||||
},
|
},
|
||||||
"types": [
|
"types": {
|
||||||
"Fix",
|
"fix": "Fixes an existing bug",
|
||||||
"Add",
|
"add": "Adds functionality",
|
||||||
"Update",
|
"update": "Update existing functionality",
|
||||||
"Dev",
|
"dev": "Development related task",
|
||||||
"Tweak",
|
"tweak": "A minor adjustment to the codebase",
|
||||||
"Performance",
|
"performance": "Address performance issues",
|
||||||
"Enhancement"
|
"enhancement": "Improve existing functionality"
|
||||||
],
|
},
|
||||||
"versioning": "wordpress",
|
"versioning": "wordpress",
|
||||||
"changelog": "NEXT_CHANGELOG.md"
|
"changelog": "NEXT_CHANGELOG.md"
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,10 +256,11 @@ class Formatter extends KeepAChangelogParser {
|
||||||
|
|
||||||
foreach ( $entry->getChangesBySubheading() as $heading => $changes ) {
|
foreach ( $entry->getChangesBySubheading() as $heading => $changes ) {
|
||||||
foreach ( $changes as $change ) {
|
foreach ( $changes as $change ) {
|
||||||
$breaking_change = 'major' === $change->getSignificance() ? ' [ **BREAKING CHANGE** ]' : '';
|
$significance = $change->getSignificance();
|
||||||
|
$breaking_change = 'major' === $significance ? ' [ **BREAKING CHANGE** ]' : '';
|
||||||
$text = trim( $change->getContent() );
|
$text = trim( $change->getContent() );
|
||||||
if ( '' !== $text ) {
|
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";
|
$ret .= $preamble . str_replace( "\n", "\n$indent", $text ) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue