Flux enforces canonical style and environment health mechanically, so reviews argue about code instead of formatting. This guide covers the three gates you run before opening a PR.
Format .flux sources
Section titled “Format .flux sources”flux fmt formats .flux files to canonical style. With no paths it formats
main.flux in the project root:
flux fmt # format main.flux in placeflux fmt src/views.flux # format specific filesGate a pipeline with --check: the files are verified but not written, and
the process exits non-zero when any file would change:
flux fmt --checkCheck environment health
Section titled “Check environment health”flux doctor runs the environment health check: toolchain state, stdlib
parse health, wire protocol version, and — best effort — connected devices
and simulators:
flux doctorIt also runs the local structural checks: approved-dependency drift (the
repository vets dependencies through ADRs, and flux doctor reports
unapproved drift) and violations of the repository’s documented house rules.
Use --strict to make advisory findings blocking, so the command can gate a
pre-commit hook:
flux doctor --strict # exits non-zero on any findingKeep the Rust gates green
Section titled “Keep the Rust gates green”If you touch the Flux implementation itself, the repository’s CI expects a
clean tree by these commands — never plain cargo test:
cargo fmt -- --checkcargo clippy -- -D warningscargo nextest runcargo test --doc # doctests: nextest does not run these| Command | Gate |
|---|---|
cargo fmt -- --check |
Formatting clean |
cargo clippy -- -D warnings |
No lints |
cargo nextest run |
Full suite (unit, property, snapshot) |
cargo test --doc |
Doctests |
Library crates forbid unsafe_code, production code contains no unwrap /
expect / panic!, and every error carries a source Span — the clippy and
nextest gates are how these rules stay true.
Next steps
Section titled “Next steps”- Testing and benchmarks for the five test
layers behind
cargo nextest run. - Project status for the CI workflow map.
