Repository navigation
feat(analyzers): add three performance rules and extend two more - #182
Merged
Merged
Conversation
Add E128229 for the Func<Task> middleware next delegate, E128230 for UseStaticFiles, and E128231 for a split result that only a foreach enumerates. Extend E128135 with min and max reduction loops and E128084 with a List indexer loop. Ship release 3.3.0 and update the README, the candidate register, and the roadmap.
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.
Executive Summary
The roadmap's active section held five analyzer shapes. Three ship as new rules and two extend shipped rules.
Func<Task>next delegate. The fix switches toRequestDelegateand passes the context.UseStaticFileswhen the compilation also declaresMapStaticAssets. No fix, because the call moves into the endpoint mapping section.foreachoverstring.Splitwith a char or constant-string separator. The fix enumeratessource.AsSpan().Split(separator)when every read of the part accepts a span.for (int i = 0; i < list.Count; i++)when the body only readslist[i]and never mutates the list.The package version moves to 3.3.0.
Code Changes
src/E128.Analyzers/Performance/: three analyzers, theSpanOperationtype, the E128135 and E128084 extensions, and the sharedIndexedForLoopbound-member overload.src/E128.Analyzers.CodeFixers/Performance/: two new fix providers and the extended E128135 and E128084 providers.src/E128.Analyzers/AnalyzerReleases.Shipped.md: aRelease 3.3.0section with three new rules and two changed rules.src/E128.Analyzers/README.md: rule rows and detail sections.lode/andplans/roadmap.md: the register, catalog, rule details, map, and roadmap now match the shipped state.One roadmap sample was wrong. It rewrote
int.Parse(part)toint.Parse(span), but the narrowest span overload also takes anIFormatProvider. E128231 reports that shape without a fix, and the docs record why.Tests and Tooling
scripts/check.sh --allpasses shell lint, the analyzer release check, format, build, and the full test suite. The README table diff and README audit report no drift. The format pass skipped the JetBrains cleanup because the tool is not installed.Review Guide
Read the three analyzers first, then the four fix providers. The tests named after each rule show the reported and suppressed shapes.
ListIndexerLoopMatcherTestsexercises the E128084 matcher against a real compilation.Rollback
Revert the commit. The change adds analyzers and docs and touches no persisted data.