Skip to content

Commit 276e350

Browse files
committed
Keep repository language stats aligned with authored TypeScript
The runtime wrappers and maintenance scripts stay in JavaScript, but GitHub's repository language bar should reflect the authored product source instead of auxiliary script formats. This adds Linguist detectability overrides in `.gitattributes` and locks them in the documentation governance suite. Constraint: Wrapper and maintenance scripts must remain directly executable without build pipeline changes Rejected: Convert scripts and wrappers to TypeScript | would widen runtime and packaging scope beyond a metadata-only change Confidence: high Scope-risk: narrow Directive: If a non-TypeScript repo artifact should count toward the language bar later, update `.gitattributes` and `test/documentation.test.ts` together Tested: `git check-attr linguist-detectable -- index.ts scripts/codex.js scripts/check-pack-budget.mjs scripts/test-all-models.sh lib/oauth-success.html`; `npm test -- test/documentation.test.ts`; `npm run lint`; `npm run typecheck`; `npm run build` Not-tested: Full `npm test` remains red on inherited `test/proactive-refresh.test.ts` timeouts reproduced on clean `origin/main`
1 parent f28c079 commit 276e350

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Keep repository language stats focused on authored TypeScript sources.
2+
*.ts linguist-detectable
3+
*.js -linguist-detectable
4+
*.mjs -linguist-detectable
5+
*.sh -linguist-detectable
6+
*.html -linguist-detectable

test/documentation.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,21 @@ function compareSemverDescending(left: string, right: string): number {
609609
expect(conduct).toContain("security.md");
610610
});
611611

612+
it("locks linguist overrides for a TypeScript-only repository language bar", () => {
613+
const gitattributes = ".gitattributes";
614+
expect(
615+
existsSync(join(projectRoot, gitattributes)),
616+
`${gitattributes} should exist`,
617+
).toBe(true);
618+
619+
const content = read(gitattributes);
620+
expect(content).toContain("*.ts linguist-detectable");
621+
expect(content).toContain("*.js -linguist-detectable");
622+
expect(content).toContain("*.mjs -linguist-detectable");
623+
expect(content).toContain("*.sh -linguist-detectable");
624+
expect(content).toContain("*.html -linguist-detectable");
625+
});
626+
612627
it("publishes maintainer runbooks for refactor-era changes", () => {
613628
const docsPortal = read("docs/README.md");
614629
const testingGuide = read("docs/development/TESTING.md");

0 commit comments

Comments
 (0)