Skip to content
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

SonarReportingContext: Add ReportIssue with SecondaryLocation #9298

Merged
merged 8 commits into from
May 27, 2024

Conversation

pavel-mikula-sonarsource
Copy link
Contributor

@pavel-mikula-sonarsource pavel-mikula-sonarsource commented May 17, 2024

Prerequisite for #9174

Review per commit shows the logical changes.
The purpose of this PR is to prepare everything that will be needed by all other rules. Migration of other rules (mainly monotounus removals of DiagnosticDescriptorExtensions.CreateDiagnostic will be in upcoming PRs)

The goals are:

  • Make ReportIssue contract clear about SecondaryLocation boundary
  • Hide the workaround with immutable dictionary of parameters
  • Make reporting of secondary issues with messages super easy
  • Fix bug where ToProperties does not respect SecondaryLocation.Message, but uses additional argument instead

I've changed params object[] to params string[] so we don't risk accidentally sending a collection of secondary locations (with a wrong type) to the params value.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nitpicks. Overall looks good.

Copy link

sonarcloud bot commented May 23, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 23, 2024

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Best Kanban
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants