From 0f7dc5d9f3291e1278d3be6c7c8ecf5804a5ebc8 Mon Sep 17 00:00:00 2001 From: Severin Ibarluzea Date: Fri, 9 Oct 2026 12:15:29 -0700 Subject: [PATCH 1/2] Document tsci check pcb-style with defaults and counted SVG output --- docs/command-line/tsci-check.md | 39 +++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/docs/command-line/tsci-check.md b/docs/command-line/tsci-check.md index 159afd7c..6559132e 100644 --- a/docs/command-line/tsci-check.md +++ b/docs/command-line/tsci-check.md @@ -1,9 +1,9 @@ --- title: tsci check -description: Partially build and validate circuit artifacts +description: Validate circuit artifacts and PCB routing style --- -`tsci check` partially builds your circuit and validates specific aspects of the output. It is useful for catching issues early without running a full build. +`tsci check` validates specific aspects of your circuit. Some subcommands use a partial build; `pcb-style` builds and routes source files before analyzing the PCB. ## Usage @@ -44,3 +44,38 @@ tsci check routing :::note These subcommands are currently under development and may not be fully implemented yet. ::: + +### `tsci check pcb-style` + +Check PCB traces for long odd-angle runs and unnecessary stair stepping. Both rules run automatically with sensible defaults: + +- Odd-angle analysis checks runs longer than 5 mm that deviate from the standard 45° routing directions, with a 4° tolerance. Splitting a long run into short segments does not hide it. +- Staircase analysis detects repeated short alternating bends, even when each individual segment follows a standard routing direction. + +```bash +# Check the project's entrypoint +tsci check pcb-style + +# Build and route a source file, then check its PCB traces +tsci check pcb-style index.tsx + +# Analyze an existing Circuit JSON file +tsci check pcb-style board.circuit.json +``` + +The optional file argument accepts a source entrypoint or a prebuilt Circuit JSON array. When omitted, the command uses the project's entrypoint. + +The command reports the issue count and affected trace locations. It also saves a highlighted SVG overview to `checks/check-pcb-style/pcb.svg`, including the number of issues detected. Clean runs write a new overview with zero issues. + +#### Output options + +| Option | Description | +| --- | --- | +| `--json` | Print the analysis as JSON. | +| `--svg ` | Choose the SVG output path. | + +```bash +tsci check pcb-style board.circuit.json --json --svg checks/style.svg +``` + +Exit code `0` means no style issues were found. Exit code `1` means style issues were found or the command encountered an input or execution error. From 86c37b92cec463325a316cc3c894fc16c46609a2 Mon Sep 17 00:00:00 2001 From: Severin Ibarluzea Date: Fri, 9 Oct 2026 13:00:04 -0700 Subject: [PATCH 2/2] Keep the check overview general and match existing command reference detail --- docs/command-line/tsci-check.md | 37 +++++++-------------------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/docs/command-line/tsci-check.md b/docs/command-line/tsci-check.md index 6559132e..0badb2fa 100644 --- a/docs/command-line/tsci-check.md +++ b/docs/command-line/tsci-check.md @@ -1,9 +1,9 @@ --- title: tsci check -description: Validate circuit artifacts and PCB routing style +description: Build and validate circuit artifacts --- -`tsci check` validates specific aspects of your circuit. Some subcommands use a partial build; `pcb-style` builds and routes source files before analyzing the PCB. +`tsci check` builds and validates specific aspects of your circuit, such as the netlist, component placement, and routing. ## Usage @@ -47,35 +47,14 @@ These subcommands are currently under development and may not be fully implement ### `tsci check pcb-style` -Check PCB traces for long odd-angle runs and unnecessary stair stepping. Both rules run automatically with sensible defaults: - -- Odd-angle analysis checks runs longer than 5 mm that deviate from the standard 45° routing directions, with a 4° tolerance. Splitting a long run into short segments does not hide it. -- Staircase analysis detects repeated short alternating bends, even when each individual segment follows a standard routing direction. +Detect long odd-angle trace runs and unnecessary stair stepping using default rules. Source files are built and routed before analysis. ```bash -# Check the project's entrypoint -tsci check pcb-style - -# Build and route a source file, then check its PCB traces -tsci check pcb-style index.tsx - -# Analyze an existing Circuit JSON file -tsci check pcb-style board.circuit.json +tsci check pcb-style [file] ``` -The optional file argument accepts a source entrypoint or a prebuilt Circuit JSON array. When omitted, the command uses the project's entrypoint. - -The command reports the issue count and affected trace locations. It also saves a highlighted SVG overview to `checks/check-pcb-style/pcb.svg`, including the number of issues detected. Clean runs write a new overview with zero issues. - -#### Output options - -| Option | Description | -| --- | --- | -| `--json` | Print the analysis as JSON. | -| `--svg ` | Choose the SVG output path. | - -```bash -tsci check pcb-style board.circuit.json --json --svg checks/style.svg -``` +- `file` *(optional)* – source entrypoint or prebuilt Circuit JSON; defaults to the project's entrypoint +- `--json` – print the analysis as JSON +- `--svg ` – choose the SVG output path (default: `checks/check-pcb-style/pcb.svg`) -Exit code `0` means no style issues were found. Exit code `1` means style issues were found or the command encountered an input or execution error. +Reports the issue count and saves a highlighted SVG overview. Exits with code `1` if style issues are found.