rspec/rules/S2343/swift/rule.adoc

46 lines
768 B
Plaintext
Raw Normal View History

== Why is this an issue?
2020-06-30 12:48:07 +02:00
Shared coding conventions allow teams to collaborate efficiently. This rule checks that all enumeration member names match a provided regular expression.
=== Noncompliant code example
2020-06-30 12:48:07 +02:00
2021-01-27 13:42:22 +01:00
With default provided regular expression: ``++^[a-z][a-zA-Z0-9]*$++``
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 12:48:07 +02:00
----
enum SomeEnumeration {
case SomeMember // Non-Compliant
}
----
=== Compliant solution
2020-06-30 12:48:07 +02:00
2022-02-04 17:28:24 +01:00
[source,swift]
2020-06-30 12:48:07 +02:00
----
enum SomeEnumeration {
case someMember
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
=== Parameters
.format
****
----
^[a-z][a-zA-Z0-9]*$
----
Regular expression used to check the enumeration value names against.
****
endif::env-github,rspecator-view[]