fleetlint Policy for a fleet of repositories
v0.7
Getting started

repo/lockfile-committed/dotnet

Dependency lockfile is committed

Implements repo/lockfile-committed for dotnet.

Severityerror
Tiers1, 2
Stacksdotnet
Scopeeach
Kindexpr
Sourcelibrary v0.4.0
Selected byfleetlint-recommended@v0.4.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: Run the package manager to produce the lockfile, remove any .gitignore entry for it, and commit it.

Sources


Generated by fleetlint docs from catalog v0.4.0.