Table of Contents

Class ReuseDirectory

Namespace
FVNever.Reuse
Assembly
FVNever.Reuse.dll

Provides high-level operations for scanning a directory and extracting REUSE licensing information from files, sidecar .license files, REUSE.toml files, and DEP-5 metadata.

public static class ReuseDirectory
Inheritance
ReuseDirectory
Inherited Members

Methods

ReadEntries(AbsolutePath)

Reads all REUSE entries discoverable within the specified directory.

public static Task<List<ReuseFileEntry>> ReadEntries(AbsolutePath directory)

Parameters

directory AbsolutePath

Absolute path to the base directory to scan.

Returns

Task<List<ReuseFileEntry>>

A task that produces a list of ReuseFileEntry values. Each entry corresponds to a file for which licensing information was found in-place, in a sidecar .license file, via matching REUSE.toml annotations, or via a matching DEP-5 stanza.

Remarks

REUSE.toml files are read from any directory level (except the ones ignored by VCS), and the licensing information from them is combined with the information from the files according to the precedence rules from the specification. The REUSE.toml files themselves are not Covered Files, so no entries are returned for them.

Note that for related formats that don't follow the REUSE specification strictly, e.g., the DEP5 machine-readable debian/copyright file contents, this method does its best to parse the copyright notices in the typical form they are provided, but can't guarantee their correctness.

Exceptions

Exception

A REUSE.toml file is invalid, or both REUSE.toml and .reuse/dep5 files are present in the directory, which is prohibited by the REUSE specification.