Skip to content

Conversation

seveibar
Copy link
Contributor

@seveibar seveibar commented Oct 5, 2025

Summary

  • include optional pcb_center coordinates on the pcb_via_clearance_error schema and interface
  • document the pcb_center field in the README error reference
  • extend the pcb_via_clearance_error test coverage to assert pcb_center parsing

Testing

  • bun test tests/pcb_via_clearance_error.test.ts
  • bunx tsc --noEmit

https://chatgpt.com/codex/tasks/task_b_68e1b1c5dec8832eb5fb48ed5a9dea1e

@seveibar seveibar changed the title Add pcb center details to via clearance error via clearance errors Oct 5, 2025
@seveibar seveibar merged commit c0307a4 into main Oct 5, 2025
4 checks passed
@seveibar seveibar deleted the codex/add-error-for-close-vias branch October 5, 2025 05:37
Comment on lines +5 to +33
test("pcb_via_clearance_error parses", () => {
const error = pcb_via_clearance_error.parse({
type: "pcb_via_clearance_error",
message: "vias too close",
pcb_via_ids: ["via_1", "via_2"],
minimum_clearance: "0.2mm",
actual_clearance: "0.1mm",
pcb_center: {
x: 12.5,
y: -3.4,
},
})

expect(error.pcb_error_id).toBeDefined()
expect(error.pcb_error_id.startsWith("pcb_error")).toBe(true)
expect(error.minimum_clearance).toBeCloseTo(0.2)
expect(error.actual_clearance).toBeCloseTo(0.1)
expect(error.pcb_center).toEqual({ x: 12.5, y: -3.4 })
})

test("any_circuit_element includes pcb_via_clearance_error", () => {
const parsed = any_circuit_element.parse({
type: "pcb_via_clearance_error",
message: "vias too close",
pcb_via_ids: ["via_1", "via_2"],
})

expect(parsed.type).toBe("pcb_via_clearance_error")
})
Copy link
Contributor

Choose a reason for hiding this comment

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

This test file violates the testing rule by containing 2 test() calls (lines 5 and 25). Test files are limited to AT MOST one test() call per file. Split these tests into separate numbered files: pcb_via_clearance_error1.test.ts and pcb_via_clearance_error2.test.ts, with each file containing only one test() call.

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

Fix in Graphite


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

@seveibar seveibar mentioned this pull request Oct 5, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant