refactor(tmp): harden temp boundary guardrails

This commit is contained in:
Peter Steinberger
2026-02-24 23:51:01 +00:00
parent de586373e0
commit def993dbd8
6 changed files with 84 additions and 27 deletions

View File

@@ -18,6 +18,14 @@ describe("check-no-random-messaging-tmp", () => {
expect(findMessagingTmpdirCallLines(source)).toEqual([3]);
});
it("finds tmpdir calls imported from os", () => {
const source = `
import os from "os";
const dir = os.tmpdir();
`;
expect(findMessagingTmpdirCallLines(source)).toEqual([3]);
});
it("ignores mentions in comments and strings", () => {
const source = `
// os.tmpdir()