Repository navigation
Build with StyleCop.Analyzers 1.3, and inject 1.3.133-beta - #401
Merged
Merged
Conversation
.globalconfig had SA1516 at none, because StyleCop.Analyzers 1.2.0-beta.556 predates C# 12 and reported the rule on syntax it did not understand. 1.3.79-beta audits every rule against C# 8 to 15, so SA1516 goes back to warning. SA1141, SA1142, SA1317, and SA1653 get an explicit severity, because the file lists every StyleCop rule. Every rule set to none gets a comment saying why. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
StyleCop.Analyzers 1.3.79-beta reports IntPtr under SA1121, which asks for the built-in alias nint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SA1500 reports an initializer, switch expression, or collection expression whose opening brace ends a line. The ReSharper formatter settings of this repository put that brace at end of line, and SA1500 has no option to accept it. Three ReSharper inspections take over the check, and they follow the formatter settings. One more formatter setting keeps auto-properties on one line, which the inspections would otherwise split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
inspectcode's rather aggressive result caching can cause inspect.cs to report false positives and false negatives. Now inspect.cs forces inspectcode to use a temporary cache directory under `.buildvana-temp` and cleans it before every invocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Initializers, switch expressions, collection expressions, with expressions, and lambda blocks need not have their opening brace on a line of its own. Updated analyzer rules enforce this, so this commit applies the rule to existing code to avoid code analysis warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StyleCop.Analyzers 1.3.79-beta reports SA1413 on a multi-line collection expression whose last element has no trailing comma. A spread over a LINQ chain gets a line of its own, so that the comma can end the chain. The closing bracket then stands alone, as in an element list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`PinDumpFixture.DumpPins` and `WritePackagePinDumpTests.ReadDumpAsync` suppressed a null result of `JsonSerializer.Deserialize` with `!`. When a pin dump file held `null`, a test failed later with a `NullReferenceException` that named no file. Both sites now throw an `InvalidOperationException` with the file path instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StyleCop.Analyzers 1.3.79-beta reports SA1115 on the Forwarded parameter of CommandParameters, because a blank line separates it from the previous parameter. SA1515 accepts the comment above Forwarded without that blank line. SA1516 reports the set accessor of GitService.CommitterIdentity, because no blank line separates it from the get accessor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ExcludeFromCodeCoverage justification of VirtualTerminal.TryEnableOnStandardError and the Options parameter comment of CommandParameters exceeded 140 characters. The declaration of OverrideSelector.SelectForCentralPin exceeded the 120-character limit for declarations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under the default `minor` policy, `bv deps update` moved the `Microsoft.Build*` pins to 18.11.0. `Microsoft.Build` 18.10.1 and later target `net11.0` instead of `net10.0`, so the restore of `Buildvana.Sdk.Tests` failed with NU1701. A newer pin would also compile `Buildvana.Sdk.Tasks` against APIs missing from MSBuild 18.9, the `BV_MinMSBuildVersion` floor. A `patch` policy keeps the `Microsoft.Build*` pins at that floor. `Microsoft.Build.Locator` keeps `minor`, because it has versions of its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Buildvana SDK injected `StyleCop.Analyzers` 1.3.79-beta, which has no SA1315, SA1654, or SX1412. An override that renamed a parameter, a `cref` with escaped angle brackets, and a C# file with a BOM all passed the build. `.globalconfig` sets the three rules to `warning`, and SX1412 takes the place of SA1412. 1.3.133-beta also adds SA1143, whose chain layout ends each line with `?` or `:`. The "Concatenated ternaries" template of `csharp-style-guide.md` starts each line with `:` instead, so SA1143 is `none`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StyleCop.Analyzers reads every setting from a `stylecop.*` key of `.globalconfig`, and `stylecop.json` only overrode those keys. Keeping both files split the StyleCop configuration in two. The new settings section of `.globalconfig` lists every setting with its value, defaults included, as `.globalconfig` already lists every StyleCop rule. StyleCop reads three settings from standard keys, such as `csharp_using_directive_placement`. Those settings stay implicit, because the standard keys already hold the values `stylecop.json` set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`standard-analyzers.md` said that a project without a `stylecop.json` file runs StyleCop with its default settings. StyleCop.Analyzers also reads each setting from a key of `.editorconfig` or `.globalconfig`, and a value in `stylecop.json` wins over the key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The StyleCop settings section of `.globalconfig` set `stylecop.documentation.companyName` and `stylecop.documentation.copyrightText` to the values of this repository. Every other setting above the solution-specific overrides holds a value that does not depend on the repository. The settings section now holds the StyleCop defaults for both, and the overrides set the values of this repository. Roslyn keeps the last value of a key repeated in one section, so the overrides win. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rdeago
commented
Oct 20, 2026
rdeago
left a comment
Member
Author
There was a problem hiding this comment.
Review by Claude. Self-review.
One blocking finding. The Microsoft.Build* policy pattern also matches Microsoft.Build.NoTargets, and holds it to patch updates. That package is an MSBuild project SDK with versions of its own. The comment on buildvana.jsonc has the details.
The codecov/patch and codecov/project checks fail on the head commit. Ric accepted both failures for this review.
The `Microsoft.Build*` pattern in the `dependencies.policies` of `buildvana.jsonc` and `buildvana.next.jsonc` also matched the `Microsoft.Build.NoTargets` pin in `global.json`. `dotnet bv deps update` would then never move that pin to a new minor version. The package has versions of its own, as `Microsoft.Build.Locator` does, and so do other `Microsoft.Build.*` packages on NuGet. The `patch` policy therefore goes to `Microsoft.Build`, `Microsoft.Build.Framework`, `Microsoft.Build.Tasks.Core`, and `Microsoft.Build.Utilities.Core` by id. Every other `Microsoft.Build.*` pin gets the default policy of its scope. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rdeago
commented
Oct 20, 2026
rdeago
left a comment
Member
Author
There was a problem hiding this comment.
Review by Claude. Self-review.
👍 Approved.
No blocking findings.
The codecov/patch and codecov/project checks fail on the head commit. Ric accepted both failures for this review.
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.
Checklist of related issues / discussions
Proposed changes
#400 moved the
StyleCop.Analyzersinjection to 1.3.79-beta, and this repository builds with that version since it pinned Buildvana SDK 2.1.781-preview.This PR fits the code and the configuration of this repository to StyleCop.Analyzers 1.3, and moves the injection to 1.3.133-beta.
PackageVersions.propsmovesStyleCop.Analyzersfrom 1.3.79-beta to 1.3.133-beta.1.3.133-beta adds SA1143, SA1315, SA1654, and SX1412.
The pin reaches this repository at the next release of Buildvana SDK.
A build of this repository with 1.3.133-beta, through a
Directory.Packages.propsoverride, reports no StyleCop diagnostic..globalconfiglists every StyleCop rule of 1.3.133-beta with an explicit severity, and every rule set tononehas a comment that says why.warning.1.2.0-beta.556 predates C# 12, and reported the rule on syntax it did not understand.
warning.SX1412 replaces SA1412, so a C# file with a BOM fails the build.
none.Its chain layout ends each line with
?or:, and the "Concatenated ternaries" template ofcsharp-style-guide.mdstarts each line with:.none.It rejects an opening brace at the end of a line, and has no option for expression braces.
Its maintainer refused one in Alternative brace placement DotNetAnalyzers/StyleCopAnalyzers#3776.
Three ReSharper inspections in
.editorconfigtake over the check, and they follow the formatter settings of this repository.stylecop.jsonto a settings section of.globalconfig, which lists every setting, defaults included.StyleCop.Analyzers reads each setting from a
stylecop.*key, andstylecop.jsononly overrode the keys.The settings section holds the StyleCop defaults for
companyNameandcopyrightText, and the solution-specific overrides at the end of.globalconfigset the values of this repository.Buildvana.slnx,CODEOWNERS,labeler.yml, andfile-formats.mdno longer namestylecop.json.withexpression, or a lambda block goes at the end of the line, not on a line of its own.A spread over a LINQ chain gets a line of its own, so that the comma can end the chain.
VirtualTerminalusesnintinstead ofIntPtr(SA1121).CommandParametersandGitService.CommitterIdentityget the blank lines SA1115 and SA1516 ask for.inspect.csgivesinspectcodean empty cache directory under.buildvana-tempon every run.inspectcodereused its cached results for unchanged files, so a change to the inspection settings reached only the changed files.buildvana.jsoncandbuildvana.next.jsoncgiveMicrosoft.Build,Microsoft.Build.Framework,Microsoft.Build.Tasks.Core, andMicrosoft.Build.Utilities.Coreapatchpolicy, which keeps them at 18.9.x.Microsoft.Build18.10.1 and later targetnet11.0, so the restore ofBuildvana.Sdk.Testsfailed with NU1701 under the defaultminorpolicy.The policy names the four ids, because other
Microsoft.Build.*packages, such asMicrosoft.Build.LocatorandMicrosoft.Build.NoTargets, have versions of their own.Microsoft.Extensions.*pins move from 10.0.11 to 10.0.13,TUnitfrom 1.66.10 to 1.75.0, and the .NET SDK inglobal.jsonfrom 10.0.400 to 10.0.402.Additional changes
PinDumpFixture.DumpPinsandWritePackagePinDumpTests.ReadDumpAsyncthrow anInvalidOperationExceptionwith the file path when a pin dump file holdsnull.They suppressed the null result of
JsonSerializer.Deserializewith!, so a test failed later with aNullReferenceExceptionthat named no file.stylecop.jsonfile runs StyleCop with its default settings.The page now says that StyleCop also reads each setting from a key of
.editorconfigor.globalconfig.Types of changes
This pull request introduces the following types of changes:
.gitattributes,.gitignore)Breaking changes
This pull request introduces breaking changes:
Checklist
🤖 Generated with Claude Code