分享命名规范是保障团队有效协作的关键因素之一。 这个规则可以基于正则检查所有函数、方法的命名。
下列代码演示了,正则为"^[a-z][a-zA-Z0-9]*$"时的匹配结果
public class MyClass {
private int myProperty;
public int getMyProperty() { // Compliant
return myProperty;
}
public void SetMyProperty(int value) { // Non-Compliant
myProperty = value;
}
}