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

public/manifest-license/rust

Package manifest declares the license

Implements public/manifest-license for rust.

Severityinfo
Tiers1
Stacksrust
Scopeeach
Kindexpr
Sourcelibrary v0.6.0
Selected byfleetlint-recommended@v0.6.0

Requirement

Cargo.toml sets package.license (SPDX), license-file or the workspace’s license, unless the crate has publish = false.

Why

Registries, SBOM tools and license checkers read the manifest, not the LICENSE file.

Capability applies when

repo.public

Check

!file("Cargo.toml") || scan("Cargo.toml", r'^\s*publish\s*=\s*false').size() > 0 || scan("Cargo.toml", r'^\s*(license\s*=\s*"[A-Za-z0-9.+ ()/-]+"|license-file\s*=|license\.workspace\s*=\s*true|license\s*=\s*\{\s*workspace\s*=\s*true)').size() > 0

Fix

Add the SPDX identifier of the LICENSE file to Cargo.toml package.license; fleetlint fix --apply does it when the LICENSE text is one recognised license.

Agent instruction: Set the manifest’s license field to the SPDX identifier matching the LICENSE file; ask if the LICENSE text is not a recognised license.

fleetlint fix can apply this rule’s fix automatically (1 action(s)).

A finding of this rule points at Cargo.toml.

Sources


Generated by fleetlint docs from catalog v0.6.0.