mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #3810 from dilanbhalla/syntaxpython
Python: Function/Class Naming Convention (Syntax)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
| NamingConventionsClasses.py:2:1:2:14 | Class badName | Class names should start in uppercase. |
|
||||
@@ -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")
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Classes/NamingConventionsClasses.ql
|
||||
@@ -0,0 +1 @@
|
||||
| NamingConventionsFunctions.py:4:5:4:25 | Function HelloWorld | Function names should start in lowercase. |
|
||||
@@ -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")
|
||||
@@ -0,0 +1 @@
|
||||
experimental/Functions/NamingConventionsFunctions.ql
|
||||
Reference in New Issue
Block a user