Skip to content

Commit cb31eab

Browse files
committed
Do not include trailing newlines in NO_CHANGES_STR
Changing `NO_CHANGES_STR` to just be the text will make it easier to insert/use. To not break anything, I added the deleted newlines to the locations where `NO_CHANGES_STR` was used.
1 parent a7afe0a commit cb31eab

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎pr-checks/bundle-changelog.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ ${NO_CHANGES_STR}`;
112112
describe("updateChangelog", async () => {
113113
await it("removes `NO_CHANGES_STR` if present in [UNRELEASED] section", async () => {
114114
const result = updateChangelog(EMPTY_CHANGELOG, "");
115-
assert.ok(!result.includes(NO_CHANGES_STR.trim()));
115+
assert.ok(!result.includes(NO_CHANGES_STR));
116116
});
117117

118118
await it("doesn't remove `NO_CHANGES_STR` if present in versioned section", async () => {
119119
const result = updateChangelog(
120120
EMPTY_CHANGELOG.replace(UNRELEASED_PLACEHOLDER, "1.2.3"),
121121
"",
122122
);
123-
assert.ok(result.includes(NO_CHANGES_STR.trim()));
123+
assert.ok(result.includes(NO_CHANGES_STR));
124124
});
125125

126126
await it("throws if there are no sections", async () => {

‎pr-checks/changelog.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import { CHANGELOG_FILE, DryRunOption } from "./config";
66
export const UNRELEASED_PLACEHOLDER = "[UNRELEASED]";
77

88
/** The default contents for a section in the changelog. */
9-
export const NO_CHANGES_STR = "No user facing changes.\n\n";
9+
export const NO_CHANGES_STR = "No user facing changes.";
1010

1111
/** Placeholder changelog content for a new release. */
1212
export const EMPTY_CHANGELOG = `# CodeQL Action Changelog
1313
1414
## ${UNRELEASED_PLACEHOLDER}
1515
16-
${NO_CHANGES_STR}`;
16+
${NO_CHANGES_STR}
17+
18+
`;
1719

1820
/**
1921
* Represents sections in a changelog.
@@ -204,7 +206,7 @@ export function processChangelogForBackports(
204206

205207
// Add an entry if we didn't keep any.
206208
if (!foundContent) {
207-
section.bodyLines.push(NO_CHANGES_STR.trim());
209+
section.bodyLines.push(NO_CHANGES_STR);
208210
}
209211
}
210212

0 commit comments

Comments
 (0)