rspec/rules/S118/java/rule.adoc
2021-04-28 18:08:03 +02:00

27 lines
630 B
Plaintext

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.
== Noncompliant Code Example
With the default regular expression: ``++^Abstract[A-Z][a-zA-Z0-9]*$++``:
----
abstract class MyClass { // Noncompliant
}
class AbstractLikeClass { // Noncompliant
}
----
== Compliant Solution
----
abstract class AbstractClass {
}
class LikeClass {
}
----