-
Notifications
You must be signed in to change notification settings - Fork 30
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 S6146: "Option Explicit" should be enabled #4582
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the LaYC format
rules/S6146/vb6/rule.adoc
Outdated
|
||
==== Noncompliant code example | ||
=== Noncompliant code example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the LaYC format: https://github.com/SonarSource/rspec/blob/master/docs/description.adoc#2-learn-as-you-code-rule-format
The file generated with the github action contains the correct format:
== Why is this an issue?
== How to fix it
You can add here a small sentence to give a short description of the fix to do.
=== Code examples
==== Noncompliant code example
==== Compliant solution
rules/S6146/vb6/rule.adoc
Outdated
Sub DoSomething(Parameter As String) | ||
' ... | ||
End Sub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be excluded of the example, it does not bring value to the description IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
rules/S6146/vb6/rule.adoc
Outdated
@@ -0,0 +1,42 @@ | |||
== Why is this an issue? | |||
|
|||
There are several compilations options available for Visual Basic source code and ``++Option Explicit++`` defines compiler behavior for implicit variable declarations. Not specifying ``++Option Explicit++`` will allow creating a variable by it's first usage. This behavior can lead to unexpected runtime errors due to typos in variable names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several compilations options available for Visual Basic source code and ``++Option Explicit++`` defines compiler behavior for implicit variable declarations. Not specifying ``++Option Explicit++`` will allow creating a variable by it's first usage. This behavior can lead to unexpected runtime errors due to typos in variable names. | |
There are several compilations options available for Visual Basic source code and `Option Explicit` defines compiler behavior for implicit variable declarations. Not specifying `Option Explicit` will allow creating a variable by it's first usage. This behavior can lead to unexpected runtime errors due to typos in variable names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Quality Gate passed for 'rspec-tools'Issues Measures |
Quality Gate passed for 'rspec-frontend'Issues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
You can preview this rule here (updated a few minutes after each push).
Implementation-Ticket: SONARVBSIX-344
Review
A dedicated reviewer checked the rule description successfully for: