Class ReuseDirectory
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
directoryAbsolutePathAbsolute 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
.licensefile, via matchingREUSE.tomlannotations, 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.tomlfile is invalid, or bothREUSE.tomland.reuse/dep5files are present in the directory, which is prohibited by the REUSE specification.