From 4ae7c08ba473cb5cbff13f40837c618b668e7beb Mon Sep 17 00:00:00 2001 From: James Ross Date: Wed, 3 Jun 2026 07:23:43 -0700 Subject: [PATCH 1/2] Fix: add standard doc root pointers --- CODE_OF_CONDUCT.md | 4 +++ CONTRIBUTING.md | 4 +++ SECURITY.md | 4 +++ .../scripts/repository-standard-docs.test.ts | 34 +++++++++++++++++++ 4 files changed, 46 insertions(+) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 SECURITY.md create mode 100644 test/unit/scripts/repository-standard-docs.test.ts diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..d28f8152f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,4 @@ +# Code Of Conduct + +The repository code of conduct lives in +[.github/CODE_OF_CONDUCT.md](.github/CODE_OF_CONDUCT.md). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..dc9669e61 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,4 @@ +# Contributing + +Repository contribution guidance lives in +[.github/CONTRIBUTING.md](.github/CONTRIBUTING.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..95d87bf8b --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,4 @@ +# Security + +Repository security and vulnerability reporting guidance lives in +[.github/SECURITY.md](.github/SECURITY.md). diff --git a/test/unit/scripts/repository-standard-docs.test.ts b/test/unit/scripts/repository-standard-docs.test.ts new file mode 100644 index 000000000..40c2d12b8 --- /dev/null +++ b/test/unit/scripts/repository-standard-docs.test.ts @@ -0,0 +1,34 @@ +import { existsSync, readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { describe, expect, it } from 'vitest'; + +const repoRoot = fileURLToPath(new URL('../../../', import.meta.url)); + +function readRepoFile(relativePath: string): string { + return readFileSync(`${repoRoot}${relativePath}`, 'utf8'); +} + +describe('repository standard docs', () => { + it('keeps root pointers to the canonical GitHub standard docs', () => { + const pointers = [ + { + rootPath: 'CODE_OF_CONDUCT.md', + githubPath: '.github/CODE_OF_CONDUCT.md', + }, + { + rootPath: 'CONTRIBUTING.md', + githubPath: '.github/CONTRIBUTING.md', + }, + { + rootPath: 'SECURITY.md', + githubPath: '.github/SECURITY.md', + }, + ]; + + for (const pointer of pointers) { + expect(existsSync(`${repoRoot}${pointer.rootPath}`)).toBe(true); + expect(existsSync(`${repoRoot}${pointer.githubPath}`)).toBe(true); + expect(readRepoFile(pointer.rootPath)).toContain(`[${pointer.githubPath}](${pointer.githubPath})`); + } + }); +}); From 4f6312b0628073268356a29ff24129699b799fe6 Mon Sep 17 00:00:00 2001 From: James Ross Date: Wed, 3 Jun 2026 14:46:54 -0700 Subject: [PATCH 2/2] Fix: standardize code of conduct heading --- CODE_OF_CONDUCT.md | 2 +- test/unit/scripts/repository-standard-docs.test.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d28f8152f..a51756cc1 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,4 @@ -# Code Of Conduct +# Code of Conduct The repository code of conduct lives in [.github/CODE_OF_CONDUCT.md](.github/CODE_OF_CONDUCT.md). diff --git a/test/unit/scripts/repository-standard-docs.test.ts b/test/unit/scripts/repository-standard-docs.test.ts index 40c2d12b8..42af68faa 100644 --- a/test/unit/scripts/repository-standard-docs.test.ts +++ b/test/unit/scripts/repository-standard-docs.test.ts @@ -14,21 +14,26 @@ describe('repository standard docs', () => { { rootPath: 'CODE_OF_CONDUCT.md', githubPath: '.github/CODE_OF_CONDUCT.md', + heading: 'Code of Conduct', }, { rootPath: 'CONTRIBUTING.md', githubPath: '.github/CONTRIBUTING.md', + heading: 'Contributing', }, { rootPath: 'SECURITY.md', githubPath: '.github/SECURITY.md', + heading: 'Security', }, ]; for (const pointer of pointers) { expect(existsSync(`${repoRoot}${pointer.rootPath}`)).toBe(true); expect(existsSync(`${repoRoot}${pointer.githubPath}`)).toBe(true); - expect(readRepoFile(pointer.rootPath)).toContain(`[${pointer.githubPath}](${pointer.githubPath})`); + const rootPointer = readRepoFile(pointer.rootPath); + expect(rootPointer).toContain(`[${pointer.githubPath}](${pointer.githubPath})`); + expect(rootPointer).toContain(`# ${pointer.heading}\n\n`); } }); });