Skip to content

feat(check): add tsci check all preflight with json/sarif output and --fail-on - #5741

Open
LBCron wants to merge 1 commit into
tscircuit:mainfrom
LBCron:feat/check-all-preflight
Open

LBCron wants to merge 1 commit into
tscircuit:mainfrom
LBCron:feat/check-all-preflight

Conversation

@LBCron

@LBCron LBCron commented Nov 9, 2026

Copy link
Copy Markdown

Part of tscircuit/tscircuit#4205 (P0 item 4: one strict, machine-readable preflight)

This adds tsci check all [file]. It builds the circuit once and runs the checks the CLI already has, then prints a single report:

  • circuit JSON errors/warnings (netlist, pin specification, placement, routing, source, unknown), plus runAllPinSpecificationChecks
  • PCB placement analysis (suboptimal_orientation is a warning, everything else is an error)
  • schematic placement analysis (warnings)
  • PCB style analysis (warnings, only when the board has traces)
  • copper shorts from @tscircuit/check-shorts (errors, only when there is a board with copper)

If the same diagnostic shows up twice (same severity, type and message), it's reported once.

# human-readable, exits 1 if there are errors
tsci check all

# the command suggested in #4205: JSON output that fails on any warning
tsci check all index.circuit.tsx --format json --fail-on warning

# SARIF 2.1.0 for code scanning, report only
tsci check all board.circuit.json --format sarif --fail-on none > preflight.sarif

--format is text (default), json or sarif. --fail-on is error (default), warning or none. Any other value exits 1 and prints an error.

The JSON output looks like { ok, failOn, file, summary: { errors, warnings, byCategory }, diagnostics: [{ severity, category, type, message }] }. With --format json or --format sarif, build logs such as "Saved autorouting paths…" go to stderr so stdout can be parsed.

Plain tsci check doesn't change and still exits 0.

Tests: tests/cli/check/check-all-preflight.test.ts covers a clean circuit in all three formats, warning-only output with the default and with --fail-on warning, error dedupe plus SARIF results with --fail-on none, rejected flag values, and a bridged-copper short.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@LBCron

LBCron commented Nov 12, 2026

Copy link
Copy Markdown
Author

Status check-in to keep this PR active — CI checks are green and the branch is mergeable against base. Happy to address any review feedback whenever convenient!

@LBCron

LBCron commented Nov 12, 2026

Copy link
Copy Markdown
Author

Keeping this PR active — all CI test suites are green and ready for maintainer review whenever convenient. Happy to rebase or adjust anything if needed!

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@LBCron

LBCron commented Nov 15, 2026

Copy link
Copy Markdown
Author

Status check-in to keep this PR active — CI checks are green and the branch is mergeable against base. Happy to address any review feedback whenever convenient!

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

@LBCron

LBCron commented Nov 20, 2026

Copy link
Copy Markdown
Author

Status check-in to keep this PR active — CI checks are green and the branch is mergeable against base. Happy to address any review feedback whenever convenient!

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant