rspec/rules/S117/vbnet/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

67 lines
1.3 KiB
Plaintext

== Why is this an issue?
Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate.This rule checks that all local variables follow a naming convention.
The default configuration is:
* Camel casing, starting with a lower case character, e.g. backColor
* Short abbreviations of 2 letters can be capitalized only when not at the beginning, e.g. id, productID
* Longer abbreviations need to be lower cased, e.g. html
=== Noncompliant code example
With the default regular expression ``++^[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$++``:
[source,vbnet]
----
Module Module1
Sub Main()
Dim Foo = 0 ' Noncompliant
End Sub
End Module
----
=== Compliant solution
[source,vbnet]
----
Module Module1
Sub Main()
Dim foo = 0 ' Compliant
End Sub
End Module
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Rename this local variable to match the regular expression: "xxx".
=== Parameters
.format
****
----
^[a-z][a-z0-9]*([A-Z]{1,3}[a-z0-9]+)*([A-Z]{2})?$
----
Regular expression used to check the names against.
****
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]