mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
Match the CI lint style in the changelog check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d1ca99027
commit
cd7c850a16
2 files changed
+7
-5
No files matched your search
@@ -42,8 +42,8 @@ function main() {
|
|||||||
for (const problem of problems) {
|
for (const problem of problems) {
|
||||||
console.log(`::error title=Invalid changelog::${escapeAnnotation(problem)}`);
|
console.log(`::error title=Invalid changelog::${escapeAnnotation(problem)}`);
|
||||||
}
|
}
|
||||||
const rules = `Valid sections are ${changelogSections.join(", ")}. `
|
const rules = `Valid sections are ${changelogSections.join(", ")}. ` +
|
||||||
+ "Each entry must reference an issue, or this pull request if there is no issue.";
|
"Each entry must reference an issue, or this pull request if there is no issue.";
|
||||||
console.log(`\n${rules}`);
|
console.log(`\n${rules}`);
|
||||||
console.log(`Expected format in the pull request description:\n\n${expectedFormat}`);
|
console.log(`Expected format in the pull request description:\n\n${expectedFormat}`);
|
||||||
if (summaryPath) {
|
if (summaryPath) {
|
||||||
|
|||||||
@@ -46,14 +46,16 @@ describe("scripts/check_pr_changelog", function() {
|
|||||||
const text = body("```", "- Orphan #1", "### Bugs", "- Fixed it", "Loose text", "```");
|
const text = body("```", "- Orphan #1", "### Bugs", "- Fixed it", "Loose text", "```");
|
||||||
assert.deepEqual(findChangelogProblems(text), [
|
assert.deepEqual(findChangelogProblems(text), [
|
||||||
"Unexpected content \"- Orphan #1\" outside of a changelog section on line 1",
|
"Unexpected content \"- Orphan #1\" outside of a changelog section on line 1",
|
||||||
"Changelog section Bugs on line 2 is not one of "
|
"Changelog section Bugs on line 2 is not one of " +
|
||||||
+ "Major Features, Features, Fixes, Changes, Breaking Changes, Meta",
|
"Major Features, Features, Fixes, Changes, Breaking Changes, Meta",
|
||||||
"Changelog entry on line 3 does not reference an issue",
|
"Changelog entry on line 3 does not reference an issue",
|
||||||
"Unexpected content \"Loose text\" on line 4",
|
"Unexpected content \"Loose text\" on line 4",
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
it("rejects the unedited template", function() {
|
it("rejects the unedited template", function() {
|
||||||
const text = body("```", "### Features", "- Added doodad to web interface. #999", "", "### Changes", "- ...", "```");
|
const text = body(
|
||||||
|
"```", "### Features", "- Added doodad to web interface. #999", "", "### Changes", "- ...", "```",
|
||||||
|
);
|
||||||
assert.deepEqual(findChangelogProblems(text), ["Changelog entry on line 5 does not reference an issue"]);
|
assert.deepEqual(findChangelogProblems(text), ["Changelog entry on line 5 does not reference an issue"]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user