fleetlint Policy for a fleet of repositories
v0.9
Getting started

repo/lockfile-committed/rust

Dependency lockfile is committed

Implements repo/lockfile-committed for rust.

Severityerror
Tiers1, 2
Stacksrust
Scopeeach
Kindexpr
Sourcelibrary v0.6.0
Selected byfleetlint-recommended@v0.6.0

Requirement

Cargo.lock is tracked when Cargo.toml declares dependencies or a workspace; a workspace member uses the Cargo.lock of the workspace root above it.

Why

Builds are reproducible only when dependency versions are pinned in git.

Check

"Cargo.lock" in tracked() || ["../", "../../", "../../../"].exists(d, file(d + "Cargo.lock") && file(d + "Cargo.toml") && text(d + "Cargo.toml").matches(r'(?m)^\[workspace\]')) || !text("Cargo.toml").matches(r'\[((workspace\.)?(dev-|build-)?dependencies|workspace)\]')

Fix

Run cargo generate-lockfile and commit Cargo.lock.

Agent instruction: Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.

A finding of this rule points at Cargo.lock.

Sources


Generated by fleetlint docs from catalog v0.6.0.