Skip to content

autorouting phase tolerances#660

Merged
seveibar merged 2 commits into
mainfrom
autorouting-phase-tolerances
May 7, 2026
Merged

autorouting phase tolerances#660
seveibar merged 2 commits into
mainfrom
autorouting-phase-tolerances

Conversation

@seveibar
Copy link
Copy Markdown
Contributor

@seveibar seveibar commented May 7, 2026

  • allow autoroutingphase to specify phase tolerances

Comment thread tests/autorouter.test.ts
Comment on lines +39 to +55
test("supports shared routing tolerances", () => {
const raw: RoutingTolerances = {
minTraceWidth: "0.12mm",
minViaHoleEdgeToViaHoleEdgeClearance: "0.2mm",
minPlatedHoleDrillEdgeToDrillEdgeClearance: "0.25mm",
minTraceToPadEdgeClearance: "0.16mm",
minPadEdgeToPadEdgeClearance: "0.18mm",
minBoardEdgeClearance: "0.4mm",
minViaEdgeToPadEdgeClearance: "0.14mm",
minViaHoleDiameter: "0.3mm",
minViaPadDiameter: "0.6mm",
}

const result = routingTolerances.parse(raw)
expect(result.minTraceWidth).toBe(0.12)
expect(result.minViaPadDiameter).toBe(0.6)
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule states that a *.test.ts file may have AT MOST one test(...), and after that the user should split into multiple, numbered files (e.g., add1.test.ts, add2.test.ts). The file tests/autorouter.test.ts already had at least one test(...) block before this PR, and this diff adds a second test("supports shared routing tolerances", ...) call. This violates the one-test-per-file rule. The new test should be moved to a separate file, e.g., tests/autorouter2.test.ts (and the existing tests renumbered accordingly, e.g., autorouter1.test.ts).

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +38 to +55
test("autorouting phase accepts routing tolerances", () => {
const raw: AutoroutingPhaseProps = {
phaseIndex: 0,
minTraceWidth: "0.12mm",
minViaHoleEdgeToViaHoleEdgeClearance: "0.2mm",
minPlatedHoleDrillEdgeToDrillEdgeClearance: "0.25mm",
minTraceToPadEdgeClearance: "0.16mm",
minPadEdgeToPadEdgeClearance: "0.18mm",
minBoardEdgeClearance: "0.4mm",
minViaEdgeToPadEdgeClearance: "0.14mm",
minViaHoleDiameter: "0.3mm",
minViaPadDiameter: "0.6mm",
}

const parsed = autoroutingPhaseProps.parse(raw)
expect(parsed.minTraceWidth).toBe(0.12)
expect(parsed.minViaPadDiameter).toBe(0.6)
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule states that a *.test.ts file may have AT MOST one test(...). The file tests/autoroutingphase.test.ts already contained at least one test(...) block before this PR (visible at lines 35–37 and 38–57 in the diff), and this diff adds another test("autorouting phase accepts routing tolerances", ...) call. This violates the one-test-per-file rule. The new test (and any others beyond the first) should be moved to separate numbered files, e.g., autoroutingphase1.test.ts, autoroutingphase2.test.ts, etc.

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@seveibar
Copy link
Copy Markdown
Contributor Author

seveibar commented May 7, 2026

CC @imrishabh18 @ShiboSoftwareDev could use help w/ pushing this through to implementation

this PR enables autoroutingphase to specify the DRC requirements for the autorouter- this can be used to enforce a different minimum trace width for example

@seveibar seveibar merged commit 2a49027 into main May 7, 2026
5 checks passed
@tscircuitbot
Copy link
Copy Markdown
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants