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

Make KnownType class and fields public, to make it usable in SyntaxFacade #6760

Merged
merged 1 commit into from Feb 15, 2023

Conversation

antonioaversa
Copy link
Contributor

@antonioaversa antonioaversa commented Feb 15, 2023

Why

The KnownType class, defined in SonarAnalyzer.Common is internal, as well as the long list of its static readonly KnownType fields.
The implementation of #6703 (#6728) required adding a new method to the SyntaxFacade class (c.p. #6728 (comment)):

public abstract bool IsKnownAttribute(SyntaxNode attribute, KnownType knownAttribute, SemanticModel semanticModel);

SyntaxFacade is a public class implemented by CSharpSyntaxFacade, in SonarAnalyzer.CSharp, and by VisualBasicSyntaxFacade in SonarAnalyzer.VisualBasic.

This PR solves the accessibility inconsistency that adding IsKnownAttribute to SyntaxFacade would produce.

The change, originally made in #6703, has been isolated into this PR to keep the git history clear.

@sonarcloud
Copy link

sonarcloud bot commented Feb 15, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@andrei-epure-sonarsource andrei-epure-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge once green

Best Kanban automation moved this from In progress to Review approved Feb 15, 2023
@andrei-epure-sonarsource andrei-epure-sonarsource merged commit c3ee7ab into master Feb 15, 2023
Best Kanban automation moved this from Review approved to Validate Peach Feb 15, 2023
@andrei-epure-sonarsource andrei-epure-sonarsource deleted the Antonio/known-type-public branch February 15, 2023 16:51
@antonioaversa antonioaversa moved this from Validate Peach to Done in Best Kanban Feb 20, 2023
@antonioaversa
Copy link
Contributor Author

https://peach.sonarsource.com/ is up, and running with the latest analyzers.

The latest Cirrus CI build has correctly analyzed most of the projects: https://cirrus-ci.com/build/6016242381750272

The change made in this PR was a change in accessibility modifiers => validation OK.

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