Repository navigation
Releases
Spdx.Expressions 1.2.0
Spdx.Expressions 1.2.0 lets applications parse an SPDX expression once and check it against different resource limits. The library targets .NET 10, has no runtime package dependencies and retains the embedded SPDX 3.29.0 catalogue.
Parser limits
SpdxExpressionParser.CheckLimitschecks a successful parse in constant time. It returnsnullwhen the original expression fits the supplied limits.SpdxDiagnostic.Limitidentifies the exceeded budget, its inclusive limit, the observed value and whether the measurement is exact or a lower bound. The diagnostic retains the original source span.- The checks cover input length, identifier length, token count, syntax node count and parenthesis depth.
Rechecking a successful parse gives the same admission result as parsing the original text under those limits. If several limits are exceeded, the first diagnostic and its position can differ.
Install
dotnet add package Spdx.Expressions --version 1.2.0NuGet package · Syntax and limits · Examples · Changes since 1.1.1
Build and test passed on Linux, Windows and macOS for the release commit.
Spdx.Compliance 0.3.0
Spdx.Compliance 0.3.0 adds source-linked license review for .NET 10. Call GetReviewConcerns() on the result of AnalyzeAlternatives or AnalyzeParsedAlternatives to report the classified terms that remain after recorded choices and locally available routes are taken into account.
Explain remaining concerns
- Read ordered groups for mixed alternatives, exception pairs and individual categories. Each term links to every contributing occurrence, including repeated terms and their original UTF-16 ranges.
- Inspect nested choices, discarded branches and locally covered occurrences. Track the exact classification rules behind each tag.
- Compare structured term identities by value across analyses. When an alias and the original declaration both supply an exception, inspect the conflict and rejected target separately.
- Customize grouping, exclude tags from branch comparisons and set independent limits for category work and group memberships.
Compatibility
Check the review status before using the groups. A complete review with no groups can still accompany a denial. Use the original evaluation for permission, actions and evidence. Both existing policy schemas, category queries, route selection and recommendation behavior remain supported.
The package depends on Spdx.Expressions 1.2.0 and NuGet.Versioning 8.0.0.
dotnet add package Spdx.Compliance --version 0.3.0Spdx.Compliance 0.2.0
Spdx.Compliance 0.2.0 adds source-aware license decisions for .NET 10 applications. Use the policy engine directly or analyze CycloneDX 1.6 components. The package depends on Spdx.Expressions 1.2.0 and NuGet.Versioning 8.0.0.
Verify a choice and explain the decision
- Reuse parsed input with
EvaluateParsed. Apply exact OR selections without a policy and inspect the remaining expression. - Compare declarations and conclusions, audit a uniquely inferred choice or explicitly accept it. Ambiguous choices require a recorded binding. Presence bans cover both compared sources, including discarded branches.
- Inspect alternative routes, request a ranked license recommendation and replay a choice. The application decides whether to adopt it.
- Use
ConclusionEvaluation.EffectiveEvaluationfor the combined decision andToOccurrenceto include it in an aggregate. Reports retain source coordinates, independent causes, action origins and incomplete coverage.
Policy and migration
Schema 2 adds exact aliases, categories, profile overrides, global prohibitions, preferences and multiple notice requirements. Pinned correction catalogs support caller-established subject identities and optional version ranges. Direct subject checks can use a catalog without CycloneDX claim markers when it contains no legacy NuGet selectors.
Schema 1 and the existing CycloneDX defaults remain supported. Opt in to conclusion verification when ready. Existing context selections address the primary field. Use an explicit source key to replay a selection against an observed declaration.
Install
dotnet add package Spdx.Compliance --version 0.2.0NuGet package · Policy, migration and examples · Decision rules · Changes since 0.1.0
Build and test passed on Linux, Windows and macOS for the release commit.
Spdx.Compliance 0.1.0
Spdx.Compliance 0.1.0 is an offline .NET 10 library for evaluating SPDX license declarations and CycloneDX 1.6 components against a caller-supplied policy.
The API reports decisions and supporting evidence for each component. It distinguishes actions required on the current path from conditions on alternative OR branches, and supports correction catalogs pinned by SHA-256.
Package on NuGet · Installation and API guide · Decision semantics
Spdx.Expressions 1.1.1
This patch speeds up the first load of the embedded SPDX catalogue and reduces allocations when formatting a single license or license reference. See performance measurements and package verification for details.
Spdx.Expressions 1.1.0
Spdx.Expressions 1.1.0
- Resolve license references offline. Use
SpdxReferenceContext.Resolvewith the parsed expression and its source document.LicenseRef-Xlooks up X in that document.DocumentRef-V:LicenseRef-Xlooks up X in the target that the source document calls V. The application supplies the documents, bindings and definitions. Each occurrence retains its source span and returns the extracted license text on success. Separate outcomes identify unknown aliases, unavailable documents, missing definitions and duplicate declarations. - Read license fields without losing the original input.
SpdxLicenseFieldReader.Readdistinguishes a missing value, an empty string,NONE,NOASSERTION, a parsed expression, invalid syntax and a parse limit being exceeded. It preserves the original text and offsets. Reading a padded expression now scans the leading whitespace once. Existing calls toParseandValidatekeep their behavior. - Display names and links for licenses and exceptions. Catalogue entries expose
Name,ReferenceandSeeAlso. Existing external catalogues remain supported, including those that omit these fields. - Build a diagnostic report. A runnable example shows a syntax error, a deprecated ID warning, an unknown ID, a
LicenseRefoccurrence and how to tell when the diagnostic list was truncated.
Spdx.Expressions 1.0.0 — Stable API, Catalogue Loading and AST Traversal
The first stable release of Spdx.Expressions: a standalone .NET 10 library for parsing, inspecting, validating and formatting SPDX license expressions, with immutable source evidence and no runtime NuGet dependencies.
New since 0.1.0
- External catalogues: load paired SPDX licence and exception catalogues from UTF-8 memory or streams using
SpdxLicenseRegistry.Load, with resource limits, structured diagnostics, cancellation and exact-byte SHA-256 identities. Caller-owned streams remain open. - AST traversal: inspect original nodes through lazy
EnumerateNodesor typedSpdxExpressionWalkercallbacks, preserving source order, explicit groups, repeated occurrences and UTF-16 spans. - Canonical identifier casing: use
FormatCanonicalCasing(expression, registry)to apply the selected catalogue’s spelling to known identifiers while preserving references, unknown identifiers, grouping and operand order.
Fixes
- Closed an immutability gap that allowed backing arrays of registry, AST and diagnostic collections to be modified through
ICollection.SyncRoot.
Stable contracts
- Established a 1.x compatibility policy covering public APIs, protected walker hooks, defaults, diagnostics and catalogue evolution.
- Preserved existing
Parse,Validateand ordinaryFormatcall patterns. Ordinary formatting continues to preserve identifier spelling. - Retained the fixed SPDX-2.3.1 expression profile and embedded SPDX License List 3.29.0.
- Catalogue selection remains explicit and offline. Patch releases retain embedded catalogue bytes; minor releases may introduce documented catalogue updates.
- Updated API documentation and examples to identify functionality available starting with 1.0.0.
Reference resolution and legal-policy decisions remain outside the library’s scope.
Verification
Release preparation passed:
- 815 tests in each of Debug and Release.
- 16 actual-package scenarios and 16 independently compiled examples.
- 66 existing consumer compatibility tests against the actual 1.0.0 package.
- Package contents, documentation and release-script checks.
Full changelog: v0.1.0...v1.0.0
v0.1.0
Initial release of Spdx.Expressions, a standalone .NET 10 library for parsing, validating and formatting SPDX license expressions.
Features
- Parse SPDX license expressions while preserving original text and source spans.
- Validate identifiers against the embedded SPDX License List v3.29.0.
- Report syntax and identifier diagnostics with source locations.
- Collect license identifiers and custom references, including repeated occurrences.
- Format spacing while preserving spelling, grouping and operand order.
- Configure processing limits and cancellation.
Requirements and scope
- Targets .NET 10.
- No runtime NuGet dependencies or network requests.
- Implements the SPDX-2.3.1 syntax profile.
- Does not resolve custom references, extract expressions from prose, or determine license compatibility.
Documentation and examples
Includes API, usage, syntax and catalogue guides, plus 11 runnable examples verified against the packaged library.
Installation
dotnet add package Spdx.Expressions --version 0.1.0Full Changelog: https://github.com/DmitryGaravsky/Spdx.Expressions/commits/v0.1.0