Skip to content

Commit 852e36e

Browse files
committed
Add static function handling to 'class_definitions_order' linter check
1 parent d8174d4 commit 852e36e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

gdtoolkit/linter/class_checks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ def _map_statement_to_section(statement: Statement) -> str:
139139
return "others"
140140
if statement.kind == "func_def":
141141
return "others"
142+
if statement.kind == "static_func_def":
143+
return "others"
142144
raise NotImplementedError
143145

144146

tests/linter/test_class_checks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ class X: var x;extends Node
8787
"""var x
8888
@tool
8989
""",
90+
"""static func foo(): pass
91+
var x
92+
""",
9093
])
9194
def test_class_definitions_order_nok(code):
9295
simple_nok_check(code, 'class-definitions-order')

0 commit comments

Comments
 (0)