-
Notifications
You must be signed in to change notification settings - Fork 649
Merge NSB0018 and NSB0004 saga mapping diagnostics with level Error #7576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: danielmarbach <174258+danielmarbach@users.noreply.github.com>
|
@copilot I found out from the documentation that we also have NSB0004.
To me it sounds like NSB0004 should be combined into NSB0018 or with NSB0018 now being an error, NSB0004 might need to go. |
Co-authored-by: danielmarbach <174258+danielmarbach@users.noreply.github.com>
You're correct! Both NSB0004 and NSB0018 detect the old saga mapping API - NSB0004 for multiple old-style mappings and NSB0018 for single old-style mappings. I've updated NSB0004 to also be an Error (from Warning) with the same "must be rewritten" messaging, since both are detecting obsolete API usage. Changes in commit c12e063. |
|
Indeed the only difference between the diagnostics was to have separate Info/Warn for the two cases. In the past:
Everything else was the same. While we don't HAVE to merge the diagnostics, since we're here and have the context rebuilt, I think it's a good idea to do so to prevent future instances of "Why are these separate diagnostics, that makes no sense."
|
|
* Merge diagnostics * Adjust message
The old saga mapping API (
ConfigureMapping,ToSaga) was obsoleted in #7510 withTreatAsErrorFromVersion = "10". The analyzer diagnostics NSB0018 and NSB0004 remained at Info and Warning severity respectively, inconsistent with the obsolete API being a compile error.Changes
NSB0018 (SagaMappingExpressionCanBeRewritten)
Diagnostic is removed, as NSB0004 will cover both cases with
DiagnosticSeverity.Error.NSB0004 (SagaMappingExpressionCanBeSimplified)
DiagnosticSeverity.WarningtoDiagnosticSeverity.ErrorContext
Both diagnostics detect the use of the old saga mapping API:
ConfigureMapping().ToSaga()calls), which was previously a Warning so that the user would simplify them with the new syntax.Since the old API is now a compile-time error, the remaining analyzer is now an error, but the code fix can still be used.
Before/After
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.