Skip to content

check: incremental checking for Python, C/C++ and every build tool - #513

Merged
rs545837 merged 1 commit into
mainfrom
feat/check-all-languages
Oct 10, 2026
Merged

rs545837 merged 1 commit into
mainfrom
feat/check-all-languages

Conversation

@rs545837

Copy link
Copy Markdown
Member

sem check now skips or narrows work for every language it detects, and in every case we measured the verdict and errors match a full run.

What changed

  • Shared layer. A checker carries the base's passing verdict when nothing it reads changed, such as docs, CI config or another language's sources. A TypeScript edit no longer reruns cargo or Gradle.
  • Python. pyright rechecks only the files whose imports can reach the change and keeps the rest of the base's errors. An edit inside the body of a function with a return annotation rechecks only that file. mypy carries.
  • pytest. Reruns only the test files that can load a change, keeping the other files' results, failures included.
  • C/C++. Compiles (-fsyntax-only) only the compile_commands.json units that include a changed file.
  • Cargo, Gradle/Maven, dotnet, SwiftPM. Carry their verdict. Cargo treats every file as an input when the crate has a build script, a proc macro or include_str!.
  • Configured commands. Carry when none of their inputs changed.

When 70% or more of a large scope is affected, pyright runs in full instead, since one full run is faster.

Measured

Project Change Full Incremental
rich (213 files) body edit in a function 33 files import 3.45s 0.94s, 1 file, identical 336 errors
rich mid-level module 3.8s 1.3s, 11 files
rich docs edit ~7.9s 0.47s
zlib (34 units) broken zutil.h 34 units 18 units, same errors
zlib inflate.c edit 34 units 2 units

Not covered yet

  • Gradle, Maven, dotnet and SwiftPM were tested only with a stand-in command, since the test machine has no JVM or .NET.
  • Java, Kotlin, C# and Swift carry or run in full, with no per-file scoping.
  • Early cutoff covers module-level annotated functions only, not methods.
  • C/C++ headers generated outside the repo aren't tracked, so run --full after regenerating them.
  • Set foreignInputs: true for a build that reads other languages' sources.

Tests

16 unit tests and 14 check_cli tests pass, including 4 new end-to-end tests for command inputs, cargo carry, C units and pytest selection.

sem check now skips or narrows work in every language it supports, and the
verdict always matches a full run.

- Shared layer: a checker carries the base's passing verdict when nothing it
  reads changed (docs, CI config, or another language's sources).
- Python: pyright rechecks only files whose imports can reach the change, with
  early cutoff for body edits in annotated functions; mypy carries.
- pytest: reruns only test files that can load a change, keeping the other
  files' results.
- C/C++: recompiles only compile_commands.json units that include a change.
- Cargo, Gradle/Maven, dotnet and SwiftPM carry their verdict; configured
  commands carry when none of their `inputs` changed.

@inspect-review inspect-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

inspect review

Triage: 112 entities analyzed | 0 critical, 0 high, 46 medium, 66 low
Verdict: standard_review

Findings (0)


Reviewed by inspect | Entity-level triage found 0 high-risk changes

@rs545837
rs545837 merged commit a7736c3 into main Oct 10, 2026
6 checks passed
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.

1 participant