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

Create rule S1312: Add C# #2488

Merged
merged 14 commits into from
Mar 12, 2024
Merged

Conversation

github-actions[bot]
Copy link
Contributor

You can preview this rule here (updated a few minutes after each push).

Review

A dedicated reviewer checked the rule description successfully for:

  • logical errors and incorrect information
  • information gaps and missing content
  • text style and tone
  • PR summary and labels follow the guidelines

@cristian-ambrosini-sonarsource cristian-ambrosini-sonarsource changed the title Create rule S1312 Create rule S1312: Add C# and VB.NET Jul 14, 2023
Copy link
Contributor

@antonioaversa antonioaversa left a comment

Choose a reason for hiding this comment

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

The rule, as defined, seems to make sense to me.
There are just some improvements to be done to wording and explanations.

rules/S1312/rule-dotnet.adoc Outdated Show resolved Hide resolved
rules/S1312/rule-dotnet.adoc Outdated Show resolved Hide resolved
rules/S1312/rule-dotnet.adoc Outdated Show resolved Hide resolved
rules/S1312/rule-dotnet.adoc Outdated Show resolved Hide resolved
rules/S1312/rule-dotnet.adoc Outdated Show resolved Hide resolved
rules/S1312/vbnet/compliant.adoc Outdated Show resolved Hide resolved
rules/S1312/vbnet/noncompliant.adoc Outdated Show resolved Hide resolved
rules/S1312/csharp/compliant.adoc Outdated Show resolved Hide resolved
rules/S1312/csharp/noncompliant.adoc Outdated Show resolved Hide resolved
rules/S1312/rspecator.adoc Show resolved Hide resolved
Copy link
Contributor

@antonioaversa antonioaversa left a comment

Choose a reason for hiding this comment

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

LGTM! Good use of variables, to support the variance of keywords.

I left a couple of discussions open, to fix some minor issues.


This rule should be activated when https://en.wikipedia.org/wiki/Service_locator_pattern[Service Locator Design pattern] is followed in place of https://en.wikipedia.org/wiki/Dependency_injection[Dependency Injection] for logging.

The rule will support the most popular logging frameworks:
Copy link
Contributor

Choose a reason for hiding this comment

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

will support -> supports

@@ -0,0 +1,3 @@
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers[Access modifiers]
* Microsoft Learn - https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/static-classes-and-static-class-members[Static class members]
Copy link
Contributor

Choose a reason for hiding this comment

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

In the VB.NET version of resources Shared is considered a keyword (i.e. it's backticked), but here static it is not (second link).
I would change here, to use backtick as for VB.NET.

Copy link
Contributor

Choose a reason for hiding this comment

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

In addition: should/can we use the adoc variables, defined at /rule.adoc level?

Choose a reason for hiding this comment

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

I don't think we should considering that those resources are already language specific, but this is not a strong opinion

@sonarqube-next
Copy link

SonarQube Quality Gate for 'rspec-frontend'

Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarqube-next
Copy link

SonarQube Quality Gate for 'rspec-tools'

Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link

Quality Gate passed Quality Gate passed for 'rspec-tools'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

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

See analysis details on SonarQube

Copy link

Quality Gate passed Quality Gate passed for 'rspec-frontend'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

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

See analysis details on SonarQube

@gregory-paidis-sonarsource gregory-paidis-sonarsource marked this pull request as ready for review March 12, 2024 12:36
@gregory-paidis-sonarsource gregory-paidis-sonarsource merged commit 68e9c93 into master Mar 12, 2024
11 checks passed
@gregory-paidis-sonarsource gregory-paidis-sonarsource deleted the rule/S1312-add-csharp branch March 12, 2024 12:59
@gregory-paidis-sonarsource gregory-paidis-sonarsource changed the title Create rule S1312: Add C# and VB.NET Create rule S1312: Add C# Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants