fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

repo/lockfile-committed/dotnet

Dependency lockfile is committed

Implements repo/lockfile-committed for dotnet.

Severityerror
Tiers1, 2
Stacksdotnet
Scopeeach
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

packages.lock.json is tracked (RestorePackagesWithLockFile) when a project references NuGet packages.

Why

Builds are reproducible only when dependency versions are pinned in git.

Check

tracked().exists(f, f == "packages.lock.json" || f.endsWith("/packages.lock.json")) || !(glob("**/*.csproj") + glob("**/*.fsproj") + glob("**/Directory.Packages.props")).exists(f, text(f).contains("PackageReference") || text(f).contains("PackageVersion"))

Fix

Set <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> in Directory.Build.props, run dotnet restore and commit the packages.lock.json files.

Agent instruction (from repo/lockfile-committed): Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.

A finding that names no file points at packages.lock.json.

Sources


Generated by fleetlint docs from catalog v0.8.0.