Module cargo_deny::licenses::cfg [−][src]
Expand description
Configuration for license checking
If a [license] configuration section, cargo-deny will use the default
configuration.
use cargo_deny::{LintLevel, licenses::Config};
let dc = Config::default();
assert_eq!(dc.unlicensed, LintLevel::Deny);
assert_eq!(
dc.allow_osi_fsf_free,
cargo_deny::licenses::cfg::BlanketAgreement::Neither
);
assert_eq!(dc.copyleft, LintLevel::Warn);
assert_eq!(dc.confidence_threshold, 0.8);
assert!(dc.deny.is_empty());
assert!(dc.allow.is_empty());
assert!(dc.clarify.is_empty());
assert!(dc.exceptions.is_empty());Structs
Some crates have complicated LICENSE files that eg contain multiple license
texts in a single file, or are otherwise sufficiently different from the
canonical license text that the confidence level cargo-deny can attribute to
them falls below the confidence-threshold you want generally across all
license texts. Clarifications allow you to manually assign the
SPDX expression
to use for a particular crate as well as 1 or more file sources used as the
ground truth for that expression. If the files change in a future version
of the crate, the clarification will be ignored and the crate will be checked
as normal.
Top level configuration for the a license check
An exception is a way for 1 or more licenses to be allowed only for a particular crate.
The path and hash of a LICENSE file
Configures how private crates are handled and detected
Enums
Allows agreement of licensing terms based on whether the license is OSI Approved or considered free by the FSF