Merge pull request #3810 from dilanbhalla/syntaxpython

Python: Function/Class Naming Convention (Syntax)
This commit is contained in:
Rasmus Wriedt Larsen
2021-04-12 10:42:17 +02:00
committed by GitHub
10 changed files with 140 additions and 0 deletions

View File

@@ -0,0 +1 @@
| NamingConventionsClasses.py:2:1:2:14 | Class badName | Class names should start in uppercase. |

View File

@@ -0,0 +1,11 @@
# BAD, do not start class or interface name with lowercase letter
class badName:
def hello(self):
print("hello")
# Good, class name starts with capital letter
class GoodName:
def hello(self):
print("hello")

View File

@@ -0,0 +1 @@
experimental/Classes/NamingConventionsClasses.ql

View File

@@ -0,0 +1 @@
| NamingConventionsFunctions.py:4:5:4:25 | Function HelloWorld | Function names should start in lowercase. |

View File

@@ -0,0 +1,9 @@
class Test:
# BAD, do not start function name with uppercase letter
def HelloWorld(self):
print("hello world")
# GOOD, function name starts with lowercase letter
def hello_world(self):
print("hello world")

View File

@@ -0,0 +1 @@
experimental/Functions/NamingConventionsFunctions.ql