Repository navigation
build: enforce .editorconfig code style on build - #22
Merged
Merged
Conversation
- Add a repo-wide .editorconfig and set EnforceCodeStyleInBuild. Test projects now treat warnings as errors as well. - Move GenerateDocumentationFile to the root props: IDE0005 only reports unused usings on build when doc comments are parsed. - Apply the cleanup the new rules require across src, tests, samples, and benchmarks. The public API is unchanged; package validation against 1.0.1 reports no differences. - Stop CI from skipping .editorconfig-only changes, since the file now affects the build.
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.
Makes the repo's code style a build failure instead of an IDE hint. No public API changes and nothing to release: the packages behave exactly like 1.0.1.
.editorconfigsets style, naming, and diagnostic severities, andEnforceCodeStyleInBuildmakes the build report them. WithTreatWarningsAsErrors, a violation fails the build.tests/Directory.Build.propsno longer turnsTreatWarningsAsErrorsoff. CONTRIBUTING says so and points atdotnet format.GenerateDocumentationFileand theCS1591suppression move fromsrc/to the root props, because IDE0005 only reports unused usings on build when doc comments are parsed. Benchmarks suppressCS1573for partially documented verification records.foreachloops in benchmark verification.CancellationTokenmoves last on the internalEventPublishStrategiesmethods and the privateEventPublishCanceledExceptionconstructor (CA1068). The public constructor keeps its parameter order under a suppression, since reordering it would break callers.Array.Empty<byte>()became[]inCommandBufferandChangeBuffer. The compiler lowers an empty[]for an array target toArray.Empty<T>(), so the measured paths are unchanged..editorconfig-only changes no longer skip the build.Validation:
dotnet build --no-incremental: 0 warnings, 0 errors.dotnet test: all pass on net462, net8.0, and net10.0.RequestFlow.Tests.Unitran 1110, 1139, and 1139 tests (2 skipped on net8.0 and net10.0);RequestFlow.Cqrs.Tests.Unitran 68 on each.dotnet pack -c Release -p:EnablePackageValidation=true -p:PackageValidationBaselineVersion=1.0.1: no compatibility diagnostics for any of the four packages.--quickrun before the next published run confirms they still build.