refactor(eventsub): use snake_case transform by default (#5916)

This commit is contained in:
pajlada
2025-02-07 20:57:07 +01:00
committed by GitHub
parent 9092f246fc
commit 02405b935a
16 changed files with 97 additions and 163 deletions
+5 -7
View File
@@ -6,7 +6,7 @@ import os
import clang.cindex
from clang.cindex import CursorKind
from .comment_commands import parse_comment_commands
from .comment_commands import CommentCommands
from .member import Member
from .enum_constant import EnumConstant
from .struct import Struct
@@ -28,7 +28,7 @@ class Walker:
case CursorKind.STRUCT_DECL:
new_struct = Struct(node.spelling, self.namespace)
if node.raw_comment is not None:
new_struct.comment_commands = parse_comment_commands(node.raw_comment)
new_struct.comment_commands.parse(node.raw_comment)
new_struct.apply_comment_commands(new_struct.comment_commands)
if struct is not None:
new_struct.parent = struct.full_name
@@ -43,7 +43,7 @@ class Walker:
case CursorKind.ENUM_DECL:
new_enum = Enum(node.spelling, self.namespace)
if node.raw_comment is not None:
new_enum.comment_commands = parse_comment_commands(node.raw_comment)
new_enum.comment_commands.parse(node.raw_comment)
new_enum.apply_comment_commands(new_enum.comment_commands)
if struct is not None:
new_enum.parent = struct.full_name
@@ -60,8 +60,7 @@ class Walker:
# log.warning(
# f"enum constant decl {node.spelling} - enum comments: {enum.comment_commands} - node comments: {node.raw_comment}"
# )
constant = EnumConstant.from_node(node)
constant.apply_comment_commands(enum.comment_commands)
constant = EnumConstant.from_node(node, CommentCommands(enum.comment_commands))
enum.constants.append(constant)
case CursorKind.FIELD_DECL:
@@ -72,8 +71,7 @@ class Walker:
# log.debug(f"{struct}: {type.spelling} {node.spelling} ({type.kind})")
if struct:
member = Member.from_field(node, self.namespace)
member.apply_comment_commands(struct.comment_commands)
member = Member.from_field(node, CommentCommands(struct.comment_commands), self.namespace)
struct.members.append(member)
case CursorKind.NAMESPACE: