Skip to content

Commit

Permalink
C++, minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobandersen committed Mar 12, 2022
1 parent 926fab0 commit 9362df5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions sphinx/domains/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3370,8 +3370,7 @@ def describe_signature(self, signode: TextElement, mode: str,


class ASTUnion(ASTBase):
def __init__(self, name: ASTNestedName,
attrs: List[ASTAttribute]) -> None:
def __init__(self, name: ASTNestedName, attrs: List[ASTAttribute]) -> None:
self.name = name
self.attrs = attrs

Expand All @@ -3397,8 +3396,7 @@ def describe_signature(self, signode: TextElement, mode: str,


class ASTEnum(ASTBase):
def __init__(self, name: ASTNestedName, scoped: str,
underlyingType: ASTType,
def __init__(self, name: ASTNestedName, scoped: str, underlyingType: ASTType,
attrs: List[ASTAttribute]) -> None:
self.name = name
self.scoped = scoped
Expand Down
3 changes: 1 addition & 2 deletions tests/test_domain_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -996,10 +996,9 @@ def test_domain_cpp_ast_attributes():
# position: parameters and qualifiers
check('function', 'void f() [[attr1]] [[attr2]]', {1: 'f', 2: '1fv'})

# position: class
# position: class, union, enum
check('class', '{key}[[nodiscard]] Foo', {1: 'Foo', 2: '3Foo'}, key='class')
check('union', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='union')
# position: enum
check('enum', '{key}[[nodiscard]] Foo', {1: None, 2: '3Foo'}, key='enum')


Expand Down

0 comments on commit 9362df5

Please sign in to comment.