Skip to content

Commit 9154d8d

Browse files
committed
Fix guard-hotpath-policy to allow lib/core/HotpathPolicy.ts
1 parent dda527d commit 9154d8d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/guard-hotpath-policy.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ const IGNORED_DIRS = new Set([
3131
"tests",
3232
]);
3333

34-
/** The only file allowed to define raw numeric hotpath policy constants. */
35-
const ALLOWED_SOURCE_FILE = "core/HotpathPolicy.ts";
34+
/** The only file(s) allowed to define raw numeric hotpath policy constants. */
35+
const ALLOWED_SOURCE_FILES = new Set([
36+
"core/HotpathPolicy.ts",
37+
"lib/core/HotpathPolicy.ts",
38+
]);
3639

3740
/**
3841
* Field names that must not receive hardcoded numeric literals outside the
@@ -108,7 +111,7 @@ async function main() {
108111
const violations = [];
109112

110113
for (const relativePath of tsFiles) {
111-
if (relativePath === ALLOWED_SOURCE_FILE) {
114+
if (ALLOWED_SOURCE_FILES.has(relativePath)) {
112115
continue;
113116
}
114117

0 commit comments

Comments
 (0)