File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ def rewrite(self,
111
111
rewrite : str ,
112
112
args : Optional [Dict [str , str ]] = None ,
113
113
* ,
114
+ diff : bool = False ,
114
115
language : Optional [str ] = None
115
116
) -> str :
116
117
logger .info ("performing rewriting of source (%s) using match template "
@@ -128,7 +129,8 @@ def rewrite(self,
128
129
raise NotImplementedError ("args are not currently supported" )
129
130
130
131
cmd = ['-stdin' , shlex .quote (match ), shlex .quote (rewrite )]
131
- cmd += ['-stdout' , '-matcher' , shlex .quote (language )]
132
+ cmd += ['-matcher' , shlex .quote (language )]
133
+ cmd += ['-diff' if diff else '-stdout' ]
132
134
cmd_s = ' ' .join (cmd )
133
135
134
136
return self .call (cmd_s , text = source )
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ def rewrite(self,
74
74
rewrite : str ,
75
75
args : Optional [Dict [str , str ]] = None ,
76
76
* ,
77
+ diff : bool = False ,
77
78
language : Optional [str ] = None
78
79
) -> str :
79
80
"""
You can’t perform that action at this time.
0 commit comments