Skip to content

Commit db877ce

Browse files
committed
fix: make all the rules works
1 parent 7380643 commit db877ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/code-quality/languages/cpp/cpp.vistor.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,17 @@ export class CPPQualityVisitor
6161
}
6262

6363
private isSnakeCase(text: string): boolean {
64-
for (let i = 0; i < text.length; i += 1) {
65-
if (isUppercase(text[i])) {
64+
// Function name without ()
65+
const functionName = text.substring(0, text.length - 2);
66+
for (let i = 0; i < functionName.length; i += 1) {
67+
if (isUppercase(functionName[i]) && functionName[i] !== '_') {
6668
return false;
6769
}
6870
}
6971
return true;
7072
}
7173

74+
// @ts-ignore
7275
private isCamelCase(text: string): boolean {
7376
const camelCaseRegex = /^[a-z][a-zA-Z0-9]*$/;
7477
return camelCaseRegex.test(text);

0 commit comments

Comments
 (0)