Skip to content

Commit 82aeebc

Browse files
committed
chore(format): apply oxfmt to synced files
Format check-paths.mts (Gap 2 sync), CLAUDE.md (sync drift), and xport.schema.json (sync drift) so CI lint passes.
1 parent cbef245 commit 82aeebc

3 files changed

Lines changed: 14 additions & 30 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ Emojis allowed sparingly: 📦 💡 🚀 🎉. Prefer text-based symbols for ter
7575

7676
### 1 path, 1 reference
7777

78-
**A path is *constructed* exactly once. Everywhere else *references* the constructed value.**
78+
**A path is _constructed_ exactly once. Everywhere else _references_ the constructed value.**
7979

80-
Referencing a single computed path many times is fine — that's the whole point of computing it once. What's banned is *re-constructing* the same path in multiple places, because that's where drift is born.
80+
Referencing a single computed path many times is fine — that's the whole point of computing it once. What's banned is _re-constructing_ the same path in multiple places, because that's where drift is born.
8181

8282
- **Within a package**: every script imports its own `scripts/paths.mts` (or `lib/paths.mts`). No `path.join('build', mode, ...)` outside that module.
8383
- **Across packages**: when package B consumes package A's output, B imports A's `paths.mts` via the workspace `exports` field. Never `path.join(PKG, '..', '<sibling>', 'build', ...)`.
8484
- **Workflows, Dockerfiles, shell scripts**: they can't `import` TS, so they construct the string once and reference it everywhere downstream. Workflows: a "Compute paths" step exposes `steps.paths.outputs.final_dir`; later steps read `${{ steps.paths.outputs.final_dir }}`. Dockerfiles/shell: assign once to a variable / `ENV`, reference by name thereafter. Each canonical construction carries a comment naming the source-of-truth `paths.mts`. **Re-building** the same path in a second step is the violation, not referring to the constructed value many times.
85-
- **Comments**: may describe path *structure* with placeholders ("`<mode>/<arch>`") but should not encode a complete literal path string. The import statement IS the comment.
85+
- **Comments**: may describe path _structure_ with placeholders ("`<mode>/<arch>`") but should not encode a complete literal path string. The import statement IS the comment.
8686

8787
Code execution takes priority over docs: violations in `.mts`/`.cts`, Makefiles, Dockerfiles, workflow YAML, and shell scripts are blocking. README and doc-comment violations are advisory unless they contain a fully-qualified path with no parametric placeholders.
8888

scripts/check-paths.mts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ const loadAllowlist = (): AllowlistEntry[] => {
229229
blockLines = []
230230
return
231231
}
232-
;(current as any)[key] = key === 'line' ? Number(unquote(trimmed)) : unquote(trimmed)
232+
;(current as any)[key] =
233+
key === 'line' ? Number(unquote(trimmed)) : unquote(trimmed)
233234
}
234235
if (line.startsWith('- ')) {
235236
if (current && current.reason) {
@@ -317,8 +318,7 @@ const isAllowlisted = (finding: Finding): boolean =>
317318
const hashProvided =
318319
typeof entry.snippet_hash === 'string' && entry.snippet_hash.length > 0
319320
if (lineProvided || hashProvided) {
320-
const lineMatches =
321-
lineProvided && entry.line === finding.line
321+
const lineMatches = lineProvided && entry.line === finding.line
322322
const hashMatches =
323323
hashProvided && entry.snippet_hash === snippetHash(finding.snippet)
324324
if (!(lineMatches || hashMatches)) {
@@ -382,7 +382,8 @@ const STRING_LITERAL_RE = /(['"])((?:\\.|(?!\1)[^\\])*)\1/g
382382
// (including those with `${...}` placeholders) so Rule A also catches
383383
// path construction via template literals like
384384
// `${buildDir}/out/Final/${binary}` or `build/${mode}/out/Final`.
385-
const TEMPLATE_LITERAL_RE = /`((?:\\.|(?:\$\{(?:[^{}]|\{[^{}]*\})*\})|(?!`)[^\\])*)`/g
385+
const TEMPLATE_LITERAL_RE =
386+
/`((?:\\.|(?:\$\{(?:[^{}]|\{[^{}]*\})*\})|(?!`)[^\\])*)`/g
386387
387388
/**
388389
* Convert a template-literal body into a synthetic forward-slash path

xport.schema.json

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
"title": "xport lock-step manifest",
55
"description": "Unified lock-step manifest shared across Socket repos. One schema, all cases — `kind` discriminator on each row selects which flavor of lock-step applies.",
66
"type": "object",
7-
"required": [
8-
"rows"
9-
],
7+
"required": ["rows"],
108
"properties": {
119
"$schema": {
1210
"type": "string"
@@ -32,10 +30,7 @@
3230
"^(.*)$": {
3331
"additionalProperties": false,
3432
"type": "object",
35-
"required": [
36-
"submodule",
37-
"repo"
38-
],
33+
"required": ["submodule", "repo"],
3934
"properties": {
4035
"submodule": {
4136
"description": "Submodule path, relative to repo root.",
@@ -57,9 +52,7 @@
5752
"^(.*)$": {
5853
"additionalProperties": false,
5954
"type": "object",
60-
"required": [
61-
"path"
62-
],
55+
"required": ["path"],
6356
"properties": {
6457
"path": {
6558
"description": "Path to the port's root directory, relative to repo root.",
@@ -212,13 +205,7 @@
212205
"additionalProperties": false,
213206
"description": "A behavioral feature reimplemented locally to match upstream behavior. Three-pillar validation: code patterns, test patterns, fixture snapshots.",
214207
"type": "object",
215-
"required": [
216-
"kind",
217-
"id",
218-
"upstream",
219-
"criticality",
220-
"local_area"
221-
],
208+
"required": ["kind", "id", "upstream", "criticality", "local_area"],
222209
"properties": {
223210
"kind": {
224211
"const": "feature-parity",
@@ -273,9 +260,7 @@
273260
"additionalProperties": false,
274261
"description": "Golden-input verification. Prefer snapshot-based diffs over hardcoded counts (brittleness lesson from sdxgen's lock-step-features).",
275262
"type": "object",
276-
"required": [
277-
"fixture_path"
278-
],
263+
"required": ["fixture_path"],
279264
"properties": {
280265
"fixture_path": {
281266
"type": "string"
@@ -425,9 +410,7 @@
425410
"additionalProperties": false,
426411
"description": "Per-port status for a lang-parity row. `implemented` = port meets assertions; `opt-out` = port consciously skips, requires non-empty `reason`.",
427412
"type": "object",
428-
"required": [
429-
"status"
430-
],
413+
"required": ["status"],
431414
"properties": {
432415
"status": {
433416
"anyOf": [

0 commit comments

Comments
 (0)