This repository was archived by the owner on Jan 13, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111from .visitor import Cursor , TreeVisitor
1212from .parser import *
1313from .result import *
14+ from .style import *
1415
1516__all__ = [
1617 'Checksum' ,
3637 'ParserBuilder' ,
3738 'ParseExceptionResult' ,
3839 'Result' ,
39- 'SourceFile'
40- ]
40+ 'SourceFile' ,
41+
42+ # Style
43+ 'Style' ,
44+ ]
Original file line number Diff line number Diff line change 44from .parser import *
55from .visitor import *
66from .markers import *
7+ from .style import *
78from .format import *
89
910__all__ = [
5354 'VariableScope' ,
5455 'YieldFrom' ,
5556
57+ # Style
58+ 'PythonStyle' ,
59+ 'SpacesStyle' ,
60+
5661 # Formatter
5762 'AutoFormat' ,
5863]
Original file line number Diff line number Diff line change 1+ from dataclasses import dataclass
2+
3+ from ..style import Style
4+
5+
6+ class PythonStyle (Style ):
7+ pass
8+
9+
10+ @dataclass (frozen = True )
11+ class SpacesStyle (PythonStyle ):
12+ @dataclass (frozen = True )
13+ class BeforeParentheses :
14+ method_call_parentheses : bool
15+ method_parentheses : bool
16+ left_bracket : bool
17+
18+ @dataclass (frozen = True )
19+ class AroundOperators :
20+ assignment : bool
21+ equality : bool
22+ relational : bool
23+ bitwise : bool
24+ additive : bool
25+ multiplicative : bool
26+ shift : bool
27+ power : bool
28+ eq_in_named_parameter : bool
29+ eq_in_keyword_argument : bool
30+
31+ @dataclass (frozen = True )
32+ class Within :
33+ brackets : bool
34+ method_parentheses : bool
35+ empty_method_parentheses : bool
36+ method_call_parentheses : bool
37+ empty_method_call_parentheses : bool
38+ braces : bool
39+
40+ @dataclass (frozen = True )
41+ class Other :
42+ before_comma : bool
43+ after_comma : bool
44+ before_semicolon : bool
45+ before_for_semicolon : bool
46+ before_colon : bool
47+ after_colon : bool
48+ before_backslash : bool
49+ before_hash : bool
50+ after_hash : bool
51+
52+ beforeParentheses : BeforeParentheses
53+ aroundOperators : AroundOperators
54+ within : Within
55+ other : Other
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from typing import Protocol
4+
5+
6+ class Style (Protocol ):
7+ def merge (self , lower_precedence : Style ) -> Style :
8+ ...
9+
10+ def apply_defaults (self ) -> Style :
11+ return self
You can’t perform that action at this time.
0 commit comments