public/manifest-license/dotnet
Package manifest declares the license
Implements public/manifest-license for dotnet.
| Severity | info |
| Tiers | 1 |
| Stacks | dotnet |
| Scope | each |
| Kind | expr |
| Source | library v0.6.0 |
| Selected by | fleetlint-recommended@v0.6.0 |
Requirement
A packable project (or Directory.Build.props) sets PackageLicenseExpression (SPDX) or PackageLicenseFile; projects that pack nothing are not checked.
Why
Registries, SBOM tools and license checkers read the manifest, not the LICENSE file.
Capability applies when
repo.publicCheck
!glob("**/*.csproj").exists(f, text(f).matches(r'<(PackageId|IsPackable>\s*true)')) || (glob("**/*.csproj") + glob("**/Directory.Build.props")).exists(f, text(f).matches(r'<PackageLicense(Expression|File)>'))Fix
Add <PackageLicenseExpression>SPDX-id</PackageLicenseExpression> to Directory.Build.props or the packable project.
Agent instruction: Set the manifest’s license field to the SPDX identifier matching the LICENSE file; ask if the LICENSE text is not a recognised license.
A finding of this rule points at Directory.Build.props.
Sources
- https://spdx.org/licenses/ (spec)
- https://fleetlint.org/baseline/#public-repositories (convention)
- https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets (spec, pack target)
- https://fleetlint.org/stacks/#net
Generated by fleetlint docs from catalog v0.6.0.