`tsci check` and `tsci check netlist` exit 0 when they report errors
Maintainer thường phản hồi trong vòng 1 ngày
@aswadi đang làm issue này rồi.
Từ ngày 12/11/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 57/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- bun, typescript
Hướng nghiên cứu
Start with cli/check/register.ts and cli/check/netlist/register.ts, then compare how cli/check/placement/register.ts sets the exit code. Read tests/cli/check/check-all-diagnostics.test.ts and reproduce with the supplied floating-pin.circuit.tsx commands. Done means both check commands return a non-zero exit code when they report errors, with the test expectations updated to match the intended behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happens
tsci check netlist and plain tsci check print Errors: 1 and exit with code 0. tsci build on the same file exits 1, and tsci check placement exits 1 when it finds errors, so scripts and CI can't rely on the exit code of these two.
Reproduction
floating-pin.circuit.tsx:
export default () => (
<board width="10mm" height="10mm" routingDisabled>
<chip
name="U1"
footprint="soic8"
pinLabels={{ pin1: "EN", pin4: "GND", pin8: "VCC" }}
pinAttributes={{
EN: { mustBeConnected: true },
VCC: { requiresPower: true },
GND: { requiresGround: true },
}}
connections={{ VCC: "net.VCC", GND: "net.GND" }}
/>
</board>
)
tsci check netlist floating-pin.circuit.tsx; echo "exit=$?"
tsci check floating-pin.circuit.tsx; echo "exit=$?"
tsci build floating-pin.circuit.tsx --disable-parts-engine; echo "exit=$?"
Expected
A non-zero exit code when Errors: is greater than 0.
Actual
$ tsci check netlist floating-pin.circuit.tsx
Errors: 1
Warnings: 0
- source_pin_must_be_connected_error: Port EN on U1 must be connected but is floating
...
exit=0
$ tsci check floating-pin.circuit.tsx
Errors: 1
Warnings: 2
- source_pin_must_be_connected_error: Port EN on U1 must be connected but is floating
...
exit=0
$ tsci build floating-pin.circuit.tsx --disable-parts-engine
Port EN on U1 must be connected but is floating
1 error(s), all written to dist/floating-pin/errors.json:
...
Build exiting with code 1: circuit build errors occurred
exit=1
For comparison, tsci check placement on a board with two overlapping 0402 resistors prints placement summary: 1 pad overlap and exits 1.
Versions
tscircuit 0.0.3161 (@tscircuit/cli 0.1.2454), Bun 1.4.4, Linux.
Cause
The netlist action and the top-level check action only print the output; process.exit(1) is reached only when an exception is thrown:
- https://github.com/tscircuit/cli/blob/575228265fd48b2e29ad4c3287b35408e883fb47/cli/check/netlist/register.ts#L99-L107
- https://github.com/tscircuit/cli/blob/575228265fd48b2e29ad4c3287b35408e883fb47/cli/check/register.ts#L25-L32
placement sets the exit code from its result (added in #4247):
https://github.com/tscircuit/cli/blob/575228265fd48b2e29ad4c3287b35408e883fb47/cli/check/placement/register.ts#L205-L210
pin_specification and source have the same shape as netlist; I haven't found an input that makes them report an error, so I haven't confirmed their exit code.
A test currently pins exit 0 for plain tsci check with Errors: 3 (https://github.com/tscircuit/cli/blob/575228265fd48b2e29ad4c3287b35408e883fb47/tests/cli/check/check-all-diagnostics.test.ts#L28-L34), so this may be intentional. #5155 tried the netlist part together with another change; the review questioned that other change and the PR was closed as stale.
Suggestion
If exit 0 is intended, a --fail-on-error flag or a note in the docs would be enough. Otherwise: return the error count from checkNetlist / check and set process.exitCode = 1 when it is non-zero, as placement does.
AI-assisted: I used Claude Code to read the source, run the reproduction above and draft this report.
- Ngôn ngữ chính
- TypeScript
- Star
- 19
- Fork
- 115
- Merge trung bình
- 1 giờ 50 phút
- Pull request đã merge (30 ngày)
- 260
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của tscircuit/cli
-
@tscircuit/cli 0.1.2452 bundles brace-expansion 2.0.1 and minimatch 5.1.2 (via make-vfs), both with published advisoriesCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
tsci dev: ngspice spiceEngine from tscircuit.config.ts fails three ways (package.json, top-level await, blob import)Có thể đã có người làm @cocvn157 đã nhận 10 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
Maintainer thường phản hồi trong vòng 1 ngày
-
tsci export -f glb can't load a relative cadModel stepUrl (404); build --glbs canCó thể đã có người làm @jeffrey-graham đã nhận 8 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
The CLI needs Bun: under Node alone `tsci` fails and the Node entry can't load `.tsx`Có thể đã có người làm @cocvn157 đã nhận 7 ngày trước. Đang mở
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
tscircuit/cli#5449 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`tsci check netlist` prints `undefined` after a resistor's value and labels resistor pins anode / cathodeCó thể đã có người làm @cocvn157 đã nhận 10 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
tscircuit/cli#5447 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của tscircuit/cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
tintinweb/pi-subagents#459 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
danielmiessler/LifeOS#2830 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
freshframework/fresh#3920 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: client enhancement priority: low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
opensro-dev/opensro#3681 ·
Maintainer thường phản hồi trong vòng 1 ngày