fix: clear the analyzer warnings in src - #109
Merged
Merged
Conversation
Four classes of warning, all real: CS1587 in nine result records. Each file ended with a documentation block describing the inherited Real property, sitting after the last member with no element to attach to. The text was useful domain detail - the range DX takes, what a dominant-cycle period means - so it moved into the class-level <remarks> rather than being deleted. CorrelResult's block only restated what its <remarks> already said, so that one is gone. CS1573 in four float overloads. Each takes an optional parameter that the documentation never mentioned. MacdFix also claimed "Uses fixed values: fastPeriod=12, slowPeriod=26, signalPeriod=9" while signalPeriod was in fact a parameter; it now says the fast and slow periods are fixed and the signal period is adjustable. IDE0290 on CandleIndicator<T>, now a primary constructor with the parameter documentation moved onto the type. Same generated constructor signature, so it is source and binary compatible. IDE0046 twice in ValidationHelper. ValidateIndexRange becomes a conditional cascade. ValidateSingleInputIndicator was a hand-rolled guard chain, so it now calls the ValidateAll helper this class already exposes and the indicators already use - one expression, still short-circuiting at the first failure, and lazier than the original since each check only runs if the previous passed. Verified: 0 errors, all four warning classes gone from src, and 1125 tests pass including the 673 candlestick tests that exercise CandleIndicator<T> through its new constructor. Note: the generated pages under docs/functions and docs/common now lag these XML comment changes. They are deliberately not regenerated here - this machine emits different character encoding than the committed output, so regenerating would bury a 15-file change under ~175 spurious diffs.
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.
Clears every instance of the four warning classes CI reported. GitHub caps annotations at 10 per job, so the reported list was a subset — this covers all of them.
<param>tagifcan be simplifiedCS1587 — nine result records
Each file ended with a documentation block describing the inherited
Realproperty, sitting after the last member with no element to attach to.The text was useful domain detail — the range DX takes, what a dominant-cycle period means — so it moved into the class-level
<remarks>rather than being deleted:CorrelResult's block only restated what its existing<remarks>already said, so that one is simply removed.CS1573 — four
float[]overloadsEach takes an optional parameter the documentation never mentioned. One of them was actively misleading:
MacdFixclaimed "Uses fixed values: fastPeriod=12, slowPeriod=26, signalPeriod=9" whilesignalPeriodwas in fact a settable parameter. It now says the fast and slow periods are fixed and the signal period is adjustable.IDE0290 —
CandleIndicator<T>Converted to a primary constructor, with the parameter documentation moved onto the type. The generated constructor signature is unchanged, so this is source and binary compatible — and it's the base class for all 61 candlestick patterns, so the 673 candle tests are the real check.
IDE0046 —
ValidationHelperValidateIndexRangebecomes a conditional cascade.ValidateSingleInputIndicatorwas a hand-rolled guard chain. Rather than nest three ternaries to satisfy the analyzer, it now calls theValidateAllhelper this same class already exposes and the indicators already use (seeAtr/TAFunc.cs):One expression, still short-circuiting at the first failure, and lazier than the original — each check now only runs if the previous one passed.
Verification
One thing to know
The generated pages under
docs/functions/anddocs/common/now lag these XML comment changes. I deliberately did not regenerate them: this machine emits different character encoding than the committed output (🡒vs→), so regenerating would bury a 15-file change under ~175 spurious diffs — exactly what went wrong on #106.They should be regenerated on a machine whose encoding matches, or the encoding should be pinned so this stops being a trap for contributors.
Worth noting on the IDE0046 rule specifically:
.editorconfigline 83 setsdotnet_style_prefer_conditional_expression_over_return = true:silent, butAnalysisModeStyle=AllinDirectory.Build.propsescalates it to a warning anyway. The .editorconfig's stated intent is being overridden. Worth reconciling those two if the style rules keep surfacing.🤖 Generated with Claude Code