rspec/rules/S116/swift/rule.adoc
Angelo Buono febb2d2152
Modify rule S116: Migrate to LayC - Field names should comply with a naming convention (#3266)
Co-authored-by: Fred Tingaud <95592999+frederic-tingaud-sonarsource@users.noreply.github.com>
2023-10-13 10:06:09 +02:00

53 lines
1.1 KiB
Plaintext

== Why is this an issue?
include::../description.adoc[]
Using the regular expression ``++^[a-z][a-zA-Z0-9]*$++``, the noncompliant code below:
[source,swift,diff-id=1,diff-type=noncompliant]
----
class MyClass {
var MyField = 1
}
----
Should be replaced with:
[source,swift,diff-id=1,diff-type=compliant]
----
class MyClass {
var myField = 1
}
----
== Resources
=== Documentation
* Microsoft - https://microsoft.github.io/swift-guide/Naming.html[Swift Guide - Naming Conventions]
* Wikipedia - https://en.wikipedia.org/wiki/Naming_convention_(programming)[Naming Convention (programming)]
=== Articles & blog posts
* Betterprogramming - https://betterprogramming.pub/naming-conventions-in-swift-4b7ca5eed4d2[Naming Conventions in Swift]
* Mobomo - https://www.mobomo.com/2017/03/naming-conventions-for-swift/[Style Guide: Swift Naming Conventions
]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../parameters.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]