Skip to content

Commit

Permalink
Prepare release (#49)
Browse files Browse the repository at this point in the history
* Minor fixup
  • Loading branch information
Jake-Shadle authored Dec 2, 2019
1 parent 2f349d4 commit 8202d7b
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 22 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.2] - 2019-12-02
### Added
- [PR#48](https://github.com/EmbarkStudios/cargo-deny/pull/48) Added an `init` subcommand to generate a
cargo-deny template file with guiding comments. Thanks [@foresterre](https://github.com/foresterre)!

## [0.4.1] - 2019-11-28
### Fixed
- [PR#46](https://github.com/EmbarkStudios/cargo-deny/pull/46) Fixed issue where `license-file` was not being
Expand Down Expand Up @@ -80,7 +85,8 @@ Now each license has to be explicitly approved, either by listing them in `licen
### Added
- Initial implementation release

[Unreleased]: https://github.com/EmbarkStudios/cargo-deny/compare/0.4.1...HEAD
[Unreleased]: https://github.com/EmbarkStudios/cargo-deny/compare/0.4.2...HEAD
[0.4.2]: https://github.com/EmbarkStudios/cargo-deny/compare/0.4.1...0.4.2
[0.4.1]: https://github.com/EmbarkStudios/cargo-deny/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/EmbarkStudios/cargo-deny/compare/0.3.0...0.4.0
[0.3.0]: https://github.com/EmbarkStudios/cargo-deny/compare/0.3.0-beta...0.3.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cargo-deny"
description = "Cargo plugin to help you manage large dependency graphs"
repository = "https://github.com/EmbarkStudios/cargo-deny"
version = "0.4.1"
version = "0.4.2"
authors = ["Embark <[email protected]>", "Jake Shadle <[email protected]>"]
edition = "2018"
license = "MIT OR Apache-2.0"
Expand Down
File renamed without changes.
37 changes: 25 additions & 12 deletions resources/template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,47 @@
# More documentation for the licenses section can be found here:
# https://github.com/EmbarkStudios/cargo-deny#the-licenses-section

# Uncomment the following line to change the lint level for unlicensed crates [possible values: "deny", "allow" or "warn"].
# Uncomment the following line to change the lint level for unlicensed crates
# [possible values: "deny", "allow" or "warn"].
#unlicensed = "deny"

# Uncomment the following line to explictly allow certain licenses [possible values: any SPDX 2.1 identifier].
# Uncomment the following line to explictly allow certain licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
#allow = []

# Uncomment the following line to explictly disallow certain licenses [possible values: any SPDX 2.1 identifier].
# Uncomment the following line to explictly disallow certain licenses
# See https://spdx.org/licenses/ for list of possible licenses
# [possible values: any SPDX 3.7 short identifier (+ optional exception)].
#deny = []

# Uncomment the following line to change the lint level for licenses considered copyleft [possible values: "deny", "allow" or "warn"].
# Uncomment the following line to change the lint level for licenses considered copyleft
# [possible values: "deny", "allow" or "warn"].
#copyleft = "warn"

# Uncomment the following line to approve or deny OSI-approved or FSF Free/Libre licenses [possible values: "both", "either", "osi-only", "fsf-only" or "neither"].
# Uncomment the following line to approve or deny OSI-approved or FSF Free/Libre licenses
# [possible values: "both", "either", "osi-only", "fsf-only" or "neither"].
#allow-osi-fsf-free = "neither"

# Uncomment the following line to change the confidence threshold. [possible values: any between 0.0 and 1.0].
# The higher the value, the more closely the license text must be to the canonical license text of a valid SPDX license file.
# Uncomment the following line to change the confidence threshold. The higher the value,
# the more closely the license text must be to the canonical license text of a valid
# SPDX license file.
# [possible values: any between 0.0 and 1.0].
#confidence-threshold = 0.8

[bans]
# This section is considered when running `cargo deny check ban`.
# More documentation about the 'bans' section can be found here:
# https://github.com/EmbarkStudios/cargo-deny#crate-bans-cargo-deny-check-ban

# Uncomment the following line to change what happens when multiple versions of the same crate are encountered [possible values: "deny", "warn" or "allow"].
# Uncomment the following line to change what happens when multiple versions of the same
# crate are encountered
# [possible values: "deny", "warn" or "allow"].
#multiple-versions = "warn"

# Uncomment the following line to change the highlighting variant used to multiple versions of the same crate when creating
# a dotgraph of your crates dependencies [possible values: "lowest-version", "simplest-path" or "all"].
# Uncomment the following line to change the highlighting variant used to multiple versions
# of the same crate when creating a dotgraph of your crates dependencies
# [possible values: "lowest-version", "simplest-path" or "all"].
#highlight = "all"

# Uncomment the following line to allow specific crates.
Expand All @@ -43,6 +55,7 @@
# Uncomment the following line to skip specific crates.
#skip = []

# Uncomment the following line to skip specific crates (including different versions of the same crate down the dependency
# tree). By default, the depth is infinite. If however desired, the depth can be ajusted.
# Uncomment the following line to skip specific crates (including different versions of the
# same crate down the dependency tree). By default, the depth is infinite, but you can also
# specify `depth = <integer>` to limit it.
#skip-tree = []
14 changes: 8 additions & 6 deletions src/cargo-deny/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ pub fn cmd(args: Args, context_dir: PathBuf) -> Result<(), Error> {
// make sure the file does not exist yet
ensure!(
std::fs::metadata(&cfg_file).is_err(),
"unable to initialize cargo deny config file ; the provided path already exists"
"unable to initialize cargo-deny config: '{}' already exists",
cfg_file.display(),
);

// make sure the path does not terminate in '..'; we need a file name.
ensure!(
&cfg_file.file_name().is_some(),
"unable to create a config file with the given name ; the given file path is not valid"
cfg_file.file_name().is_some(),
"unable to create cargo-deny config: '{}' has an invalid filename",
cfg_file.display(),
);

log::info!("saving config file to: {}", &cfg_file.display());

std::fs::write(cfg_file, CONTENTS).context("unable to write config file")?;
std::fs::write(&cfg_file, CONTENTS).context("unable to write config file")?;
log::info!("saved config file to: {}", cfg_file.display());

Ok(())
}
2 changes: 1 addition & 1 deletion src/licenses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
sync::Arc,
};

const LICENSE_CACHE: &[u8] = include_bytes!("../spdx_cache.bin.zstd");
const LICENSE_CACHE: &[u8] = include_bytes!("../resources/spdx_cache.bin.zstd");

const fn lint_deny() -> LintLevel {
LintLevel::Deny
Expand Down

0 comments on commit 8202d7b

Please sign in to comment.