Skip to content

Commit 9fa702e

Browse files
committed
feat: add rule on python function length
1 parent 60a8ef2 commit 9fa702e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/code-quality/RULES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ This file contains all the rules for the supported languages.
55
* If the function names are not in snake case, decrease score of 3 points
66
* If the function names is longer than 25 characters, decrease score of 1 points
77
* If the function body contains more than 30 lines, decrease score of 5 points
8-
* If the line in a function have more than 80 characters, decrease score of 1 point
8+
* If the line in a function have more than 80 characters, decrease score of 1 point
9+
10+
## Python
11+
* If the function names are not in snake case, decrease score of 3 points
12+
* If the function names is longer than 25 characters, decrease score of 1 points

src/code-quality/languages/python/python.visitor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export class PythonVisitor {
2424
if (!CommonQualityFunction.isSnakeCase(funcName)) {
2525
this.codeQuality.score -= 3;
2626
}
27+
if (funcName.length > 25) {
28+
this.codeQuality.score -= 1;
29+
}
2730
}
2831
});
2932
},

0 commit comments

Comments
 (0)