Repository navigation
Clear two analyzer warnings on dev (CA1068 in DarlingAgReader, CA2249 in FactAdvice) - #4491
Merged
Merged
Conversation
CA1068 in DarlingAgReader.GetAgHealthAsync (limit was after the CancellationToken; moved before it and updated callers to name the token). CA2249 in FactAdvice.IsVowel (IndexOf(c) >= 0 replaced with Contains(c)). No behavior change.
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.
REPORT: branch fix/dev-two-analyzer-warnings @ 11bb395, off origin/dev @ d909622. macOS build (Release, EnableWindowsTargeting=true): Darling.Tests 0 Warning(s) / 0 Error(s); Lite.Tests 0 Warning(s) / 0 Error(s). No CA1068/CA2249 lines in either build's output.
Why
dev's Windows CI
buildjob went from 0 warnings to 2 after recent merges: CA1068 (DarlingAgReader.GetAgHealthAsyncput an optionallimitparameter after theCancellationToken) and CA2249 (FactAdvice.IsVowelused"aeiouAEIOU".IndexOf(c) >= 0where.Contains(c)says the same thing more directly). The release needs a zero-warning Windows build.What changes
DarlingAgReader.GetAgHealthAsync: moved theint? limit = nullparameter to sit beforeCancellationToken cancellationToken = default, matching the analyzer's required parameter order. Updated every caller that passed the token positionally (three test files) to name the token (cancellationToken: ct) so the argument still lands on the right parameter; the one production caller inDarlingMcpAgTools.csalready used named arguments and needed no change. The/api/agendpoint caller inDarlingWebEndpoints.cswas passing the token positionally too and now names it.FactAdvice.IsVowel: replaced"aeiouAEIOU".IndexOf(c) >= 0with"aeiouAEIOU".Contains(c). Same result, no behavior change.Test plan
Pure signature reorder and a string-search rewrite; no behavior change, so no RED/GREEN pin is required here. The pin is the Windows CI build's
Warning(s)count at this PR's head, which is read from the build log before review.Ran locally on macOS (in-process,
Microsoft.WindowsDesktop.Appstripped from the runtimeconfig):DarlingMcpAgToolsSurfaceTests: 6/6 passed.DarlingMcpAgToolsLivePostgresTests: 8 total, 8 skipped (no rig on this machine).AvailabilityGroupCountReadTests: 2 total, 1 skipped (live, no rig).DarlingAgStatesReaderLiveEqualityTests: 2 total, 2 skipped (live, no rig).FactAdvicePluralTests: 4/4 passed.FactAdvicePluralWiringTests: 2/2 passed.DocCommentHygieneTests: 77/77 passed.Also built
Darling.Tests.csprojandLite.Tests.csprojin Release with-p:EnableWindowsTargeting=true, grepping forwarning CA1068|warning CA2249|Warning\(s\): both projects report0 Warning(s)/0 Error(s).Darling.Tests/Lite.Teststargetnet10.0-windowsand build here but cannot run their WPF-touching members on macOS; none of the classes run above touchPresentationFramework, so all listed results are real runs, not skips-for-platform-reasons.Grepped for any source-text pin on the
GetAgHealthAsyncsignature or call shape across the census/source test files; found none, so no additional test needed updating.CHANGELOG
None: an analyzer cleanup (a parameter reorder,
IndexOf→Contains); no user-visible change.