rspec/rules/S118/java/rule.adoc

27 lines
630 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Sharing some naming conventions is a key point to make it possible for a team to efficiently collaborate. This rule allows to check that all ``++abstract++`` class names match a provided regular expression. If a non-abstract class match the regular expression, an issue is raised to suggest to either make it abstract or to rename it.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
With the default regular expression: ``++^Abstract[A-Z][a-zA-Z0-9]*$++``:
----
abstract class MyClass { // Noncompliant
}
class AbstractLikeClass { // Noncompliant
}
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
----
abstract class AbstractClass {
}
class LikeClass {
}
----