File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,7 @@ Style/SafeNavigation:
244
244
Style/SignalException :
245
245
Exclude :
246
246
- Rakefile
247
+ - " **/*.rake"
247
248
248
249
# We use these sparingly, where we anticipate future branches for the
249
250
# inner conditional.
Original file line number Diff line number Diff line change @@ -59,12 +59,19 @@ multitask(:syntax_tree) do
59
59
# 2. at label `l1`, join previously annotated line with `class | module` information.
60
60
pst = sed + [ subst , "--" ]
61
61
62
+ success = false
63
+
62
64
# transform class aliases to type aliases, which syntax tree has no trouble with
63
65
sh ( "#{ find . shelljoin } | #{ pre . shelljoin } " )
64
66
# run syntax tree to format `*.rbs` files
65
- sh ( "#{ find . shelljoin } | #{ fmt . shelljoin } " )
67
+ sh ( "#{ find . shelljoin } | #{ fmt . shelljoin } " ) do
68
+ success = _1
69
+ end
66
70
# transform type aliases back to class aliases
67
71
sh ( "#{ find . shelljoin } | #{ pst . shelljoin } " )
72
+
73
+ # always run post-processing to remove comment marker
74
+ fail unless success
68
75
end
69
76
70
77
multitask ( format : [ :ruboformat , :syntax_tree ] )
Original file line number Diff line number Diff line change @@ -114,7 +114,9 @@ def coerce(value, state:)
114
114
#
115
115
# @return [String]
116
116
def inspect ( depth : 0 )
117
- return super ( ) if depth . positive?
117
+ if depth . positive?
118
+ return is_a? ( Module ) ? super ( ) : self . class . name
119
+ end
118
120
119
121
members = values . map { OpenAI ::Internal ::Type ::Converter . inspect ( _1 , depth : depth . succ ) }
120
122
prefix = is_a? ( Module ) ? name : self . class . name
Original file line number Diff line number Diff line change @@ -215,7 +215,9 @@ def dump(value, state:)
215
215
#
216
216
# @return [String]
217
217
def inspect ( depth : 0 )
218
- return super ( ) if depth . positive?
218
+ if depth . positive?
219
+ return is_a? ( Module ) ? super ( ) : self . class . name
220
+ end
219
221
220
222
members = variants . map { OpenAI ::Internal ::Type ::Converter . inspect ( _1 , depth : depth . succ ) }
221
223
prefix = is_a? ( Module ) ? name : self . class . name
You can’t perform that action at this time.
0 commit comments