Skip to content
Permalink
Browse files

Lower camel case and Pascal case.

  • Loading branch information...
Michal Nowak
Michal Nowak committed Mar 23, 2019
1 parent b4e707b commit 3225c0a6bb986d5217a4bbe1043d83ff6ed73d42
@@ -1,7 +1,7 @@
import csharp

/**
* A mutable local variable.
* Camel case string, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.
*/
class MutableLocalVariable extends LocalVariable
{
@@ -1,7 +1,7 @@
import csharp

/**
* Pascal case string.
* Pascal case string, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.
*/
class PascalCaseString extends string
{
@@ -11,6 +11,6 @@ class PascalCaseString extends string
bindingset[this]
PascalCaseString()
{
this.regexpMatch("^[A-Z][a-z]+(?:[A-Z][a-z]+)*$")
this.regexpMatch("^[^0-9a-z][a-zA-Z0-9]?([a-z0-9]+[A-Z]?)*$")
}
}
@@ -1,6 +1,6 @@
/**
* @name UCS_0_0
* @description Class names should follow PascalCasing.
* @description Class name must follow Pascal casing, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.
* @kind problem
* @problem.severity error
* @precision very high
@@ -18,7 +18,7 @@ and
not c.getName() instanceof PascalCaseString

select
c, "Class '$@' name should follow PascalCasing.",
c, "Class '$@' name should follow Pascal casing, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.",
c, c.toString()

order
@@ -1,6 +1,6 @@
/**
* @name UCS_0_1
* @description Mutable local variable should follow lowerCamelCase.
* @description Mutable local variable name must follow lower camel casing, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.
* @kind problem
* @problem.severity error
* @precision very high
@@ -17,7 +17,7 @@ where
not mutableLocalVariable.getName() instanceof LowerCamelCaseString

select
mutableLocalVariable, "Mutable local variable '$@' name should follow lower camel case string, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.",
mutableLocalVariable, "Mutable local variable '$@' name should follow lower camel casing, no abbreviations, not starting from number, no characters outside of English alphabet and Western Arabic numerals.",
mutableLocalVariable, mutableLocalVariable.toString()

order

0 comments on commit 3225c0a

Please sign in to comment.
You can’t perform that action at this time.