Skip to content

Commit 1ced68e

Browse files
committed
Do not validate change-note file names or frontmatter
Presently, the strict filename or frontmatter are not being used; so we're validating them unnecessarily. So, for now, remove these checks until we decide to either do something with them, or delete the code entirely.
1 parent 5aa5056 commit 1ced68e

2 files changed

Lines changed: 1 addition & 35 deletions

File tree

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -154,26 +154,6 @@ await describe("isValidChangenoteFile", async () => {
154154
assert.equal(isValidChangenoteFile("non-existent-file.md"), false);
155155
});
156156

157-
await it("rejects invalid filename", async () => {
158-
await withTmpFile(
159-
"fix-bug.md",
160-
"---\ncategory: fix\n---\n- Fixed a bug\n",
161-
(filePath) => {
162-
assert.equal(isValidChangenoteFile(filePath), false);
163-
},
164-
);
165-
});
166-
167-
await it("rejects missing frontmatter", async () => {
168-
await withTmpFile(
169-
"2026-01-01-fix-bug.md",
170-
"- Fixed a bug\n",
171-
(filePath) => {
172-
assert.equal(isValidChangenoteFile(filePath), false);
173-
},
174-
);
175-
});
176-
177157
await it("rejects invalid Markdown", async () => {
178158
await withTmpFile(
179159
"2026-01-01-fix-bug.md",

‎pr-checks/changelog/validate.ts‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,7 @@ export function isValidChangenoteFile(filename: string): boolean {
9595
return false;
9696
}
9797

98-
const { data: frontmatter, content } = matter(fileData);
99-
100-
if (!isValidChangenoteFilename(path.basename(filename))) {
101-
isValid = false;
102-
console.error(
103-
`${filename}: invalid filename; must match pattern YYYY-MM-DD-id.md`,
104-
);
105-
}
106-
if (!hasValidChangenoteCategory(frontmatter)) {
107-
isValid = false;
108-
const categories = Object.keys(VALID_CHANGE_NOTE_CATEGORIES).join(", ");
109-
console.error(
110-
`${filename}: invalid category; must be one of: ${categories}`,
111-
);
112-
}
98+
const { content } = matter(fileData);
11399
if (!isValidChangenoteContent(content)) {
114100
isValid = false;
115101
console.error(

0 commit comments

Comments
 (0)