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

lint/dotnet-config

Nullable, analyzers and warnings as errors are on for every project

Severitywarning
Tiersall
Stacksdotnet
Scopeeach
Kindexpr
Sourcelibrary v0.0.0-20261011205826-ecb4e9b3ffd4
Selected byfleetlint-recommended@0.1.0

Requirement

Directory.Build.props at the root sets <Nullable>enable, <TreatWarningsAsErrors>true and <AnalysisLevel>latest-recommended or latest-all for every project, or .editorconfig sets dotnet_analyzer_diagnostic.severity.

Why

Per-project settings drift; one file at the root makes every project in the solution compile under the same rules.

Check

(file("Directory.Build.props") && text("Directory.Build.props").matches("<Nullable>\\s*enable")
  && text("Directory.Build.props").matches("<TreatWarningsAsErrors>\\s*true")
  && text("Directory.Build.props").matches("<AnalysisLevel>\\s*latest"))
|| (file(".editorconfig") && text(".editorconfig").contains("dotnet_analyzer_diagnostic.severity"))

Fix

Add Directory.Build.props with Nullable, TreatWarningsAsErrors and AnalysisLevel (fleetlint fix --apply writes it).

Agent instruction: Add Directory.Build.props from the template at the repository root and fix the warnings that become errors instead of lowering the level.

fleetlint fix can apply this rule’s fix automatically (1 action(s)).

See: https://fleetlint.org/stacks/#net


Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.