build(public): fail build when src/public/ project lacks README.md #31
No reviewers
Labels
No labels
bug
commercial
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jasoncouture/llama-shears!31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/public-readme-required"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Pit-of-success enforcement of the existing "every package under
src/public/ships aREADME.md" rule. Resolves the TASKS.md item under Build / infrastructure (line 79).What's in here
New file:
src/public/Directory.Build.targetsdefiningLlamaShearsValidatePublicReadme(runsBeforeTargets="CoreCompile", skipped onDesignTimeBuild):LSPUB0001—README.mdis missing for a project undersrc/public/.LSPUB0002—README.mdexists but its content is empty / whitespace-only.The targets file imports the parent
Directory.Build.targetsfirst, so the existingLlamaShears.DocsBuildwiring (which already referencesREADME.mdwhen present) continues to apply unchanged for everysrc/public/project.Why an MSBuild error and not a docs-build assertion
The docs-build target already does
Exists('$(MSBuildProjectDirectory)\README.md')and shrugs when absent (_LlamaShearsAssemblyReadmestays empty). That kept the docs build robust to projects without a readme — but it also meant a new public package could ship with no NuGet readme and nodocs/apilead-in without anyone noticing. Promoting the missing/empty case to a hard build error closes that gap.The check is in
src/public/Directory.Build.targetsrather than the docs-build targets so the scope is the location-driven packable contract, not the doc generator. A future packable project outsidesrc/public/(if that ever happens) would need its own opt-in.Test plan
dotnet build LlamaShears.slnx— clean, 0 warnings, 0 errors.src/public/LlamaShears.Core.Abstractions.Paths/README.md, build emittederror LSPUB0001and failed.\n\n \t\n, build emittederror LSPUB0002and failed.docs-api-up-to-datepre-push check passed.🤖 Generated with Claude Code
All committers have signed the CLA.
Pull request overview
Adds an MSBuild “pit-of-success” enforcement for projects under
src/public/to ensure they always ship a non-emptyREADME.md, aligning public package expectations with the existing docs generation behavior.Changes:
src/public/Directory.Build.targetsthat runs a pre-compile validation target forREADME.md.README.mdis missing (LSPUB0001) or whitespace-only (LSPUB0002).💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@ -0,0 +23,4 @@<PropertyGroup Condition=" Exists('$(_LlamaShearsPublicReadmePath)') "><_LlamaShearsPublicReadmeContent>$([System.IO.File]::ReadAllText('$(_LlamaShearsPublicReadmePath)').Trim())</_LlamaShearsPublicReadmeContent></PropertyGroup>_LlamaShearsPublicReadmePathuses a Windows-style\path separator, and that string is then passed intoSystem.IO.File::ReadAllText(...). On non-Windows builds,ReadAllTextwon’t treat\as a directory separator, so this can throw/file-not-found even when README.md exists. Use a cross-platform path (e.g.,$(MSBuildProjectDirectory)/README.mdorSystem.IO.Path::Combine('$(MSBuildProjectDirectory)','README.md'), optionally wrapped with MSBuild path normalization) before callingReadAllText.