Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

license-scan/tool: Bump rust dependencies #95

Merged
merged 2 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 29 additions & 28 deletions license-scan/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 license-scan/clarify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ license-files = [
{ path = "LICENSE.Apache-2.0", hash = 0x7b466be4 },
{ path = "LICENSE.Mit", hash = 0xa237d234 },
{ path = "LICENSE.BSD-3-Clause", hash = 0xc9f5c4f6 },
{ path = "zstd/LICENSE", hash = 0x79cda15 },
{ path = "zstd/LICENSE", hash = 0x3bfe1fb1 },
]
skip-files = [
"zstd/COPYING", # copy of the GPLv2 we are not choosing from libzstd's dual license
Expand Down
12 changes: 6 additions & 6 deletions license-scan/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ fn write_attribution(
clarifications: &Clarifications,
stated_license: Option<Expression>,
) -> Result<()> {
eprintln!("{}:", name);
eprintln!("{name}:");
if let Some(stated_license) = stated_license.as_ref() {
eprintln!(" + {} (stated in metadata)", stated_license);
eprintln!(" + {stated_license} (stated in metadata)");
}
let mut files = HashMap::new();
for entry in WalkBuilder::new(scan_dir).types(TYPES.clone()).build() {
Expand All @@ -316,7 +316,7 @@ fn write_attribution(
.collect();
let license = if let Some(clarified) = clarifications.get(name, file_hashes)? {
let expression = clarified.expression.to_string();
eprintln!(" ! {} (clarified)", expression);
eprintln!(" ! {expression} (clarified)");
copy_files(out_dir, &files, clarified.skip_files)?;
expression
} else {
Expand Down Expand Up @@ -394,15 +394,15 @@ fn write_attribution(
licenses.sort_unstable();
licenses.dedup();
let expression = licenses.join(" AND ");
eprintln!(" = {}", expression);
eprintln!(" = {expression}");
expression
}
};

fs::create_dir_all(out_dir)?;
fs::write(
out_dir.join("attribution.txt"),
format!("{}\nSPDX-License-Identifier: {}\n", name, license),
format!("{name}\nSPDX-License-Identifier: {license}\n"),
)?;
Ok(())
}
Expand All @@ -421,7 +421,7 @@ fn copy_files(
if let Some(parent) = path.parent() {
fs::create_dir_all(parent)?;
}
fs::write(path, &data)?;
fs::write(path, data)?;
}
Ok(())
}
Expand Down
Loading