Skip to content

Commit

Permalink
Report missing licenses or copyright text.
Browse files Browse the repository at this point in the history
Required because spdx-rs 0.5.3 added support for SPDX  2.3 documents and made these fields optional.
  • Loading branch information
jonathanpallant committed Nov 21, 2023
1 parent ce0051a commit d45eac3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tools/collect-license-metadata/src/reuse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ pub(crate) fn collect(

let mut result = Vec::new();
for file in document.file_information {
let concluded_license = file.concluded_license.expect("File should have licence info");
let copyright_text = file.copyright_text.expect("File should have copyright text");
let license = interner.intern(License {
spdx: file.concluded_license.to_string(),
copyright: file.copyright_text.split('\n').map(|s| s.into()).collect(),
spdx: concluded_license.to_string(),
copyright: copyright_text.split('\n').map(|s| s.into()).collect(),
});

result.push((file.file_name.into(), license));
Expand Down

0 comments on commit d45eac3

Please sign in to comment.