Enable warnings-as-errors via Directory.Build.props (closes #310)#315
Open
wrigjl wants to merge 1 commit into
Open
Enable warnings-as-errors via Directory.Build.props (closes #310)#315wrigjl wants to merge 1 commit into
wrigjl wants to merge 1 commit into
Conversation
) Add a repo-root Directory.Build.props setting TreatWarningsAsErrors=true. MSBuild auto-imports it into every project (API.csproj and redux-tests), so any compiler warning is now a hard build failure -- the equivalent of gcc -Werror. The CSharpAPI base builds clean (0 warnings, 555 tests pass) now that ReduxISU#306-ReduxISU#309 have landed, so this cannot regress above zero. CS1591 (missing XML doc comments) is kept strict: API.csproj already sets GenerateDocumentationFile=true and emits zero such warnings, so future undocumented public members will now fail the build. Remove the now-redundant warning-gate job from main.yml: the regular build job fails on any warning, so the warning-count ratchet is obsolete. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #310.
What
Directory.Build.propswithTreatWarningsAsErrors=true. MSBuild auto-imports it into every project (API.csprojandredux-tests), so any compiler warning is now a hard build failure — thegcc -Werrorequivalent.warning-gatejob from.github/workflows/main.yml. With warnings as errors, the regularbuildjob fails on any warning, so the warning-count ratchet is obsolete.CS1591 policy
Kept strict.
API.csprojalready setsGenerateDocumentationFile=trueand currently emits zero CS1591 warnings, so-Werroris safe today; future undocumentedpublicmembers will now fail the build (as recommended in the issue).Precondition
The four warning-fix PRs (#306–#309) have all landed, so the
CSharpAPIbase builds clean.Verification (local, Release,
--no-incremental)dotnet build Redux.slnx(props enforcing): 0 Warning(s), 0 Error(s)dotnet test Redux.slnx: 555 passed, 0 failed🤖 Generated with Claude Code