File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class Formatter < PrettierPrint
14
14
# Note that we're keeping this in a global-ish hash instead of just
15
15
# overriding methods on classes so that other plugins can reference this if
16
16
# necessary. For example, the RBS plugin references the quote style.
17
- OPTIONS = { quote : "\" " , trailing_comma : false }
17
+ OPTIONS = { quote : "\" " , trailing_comma : false , line_width : 80 }
18
18
19
19
COMMENT_PRIORITY = 1
20
20
HEREDOC_PRIORITY = 2
@@ -23,15 +23,18 @@ class Formatter < PrettierPrint
23
23
24
24
# These options are overridden in plugins to we need to make sure they are
25
25
# available here.
26
- attr_reader :quote , :trailing_comma
26
+ attr_reader :quote , :trailing_comma , :line_width
27
27
alias trailing_comma? trailing_comma
28
28
29
29
def initialize (
30
30
source ,
31
31
*args ,
32
32
quote : OPTIONS [ :quote ] ,
33
- trailing_comma : OPTIONS [ :trailing_comma ]
33
+ trailing_comma : OPTIONS [ :trailing_comma ] ,
34
+ line_width : OPTIONS [ :line_width ]
34
35
)
36
+ # Loads custom line_width plugin
37
+ args [ 1 ] = line_width
35
38
super ( *args )
36
39
37
40
@source = source
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ SyntaxTree ::Formatter ::OPTIONS [ :line_width ] = 120
You can’t perform that action at this time.
0 commit comments