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,
111111 rewrite : str ,
112112 args : Optional [Dict [str , str ]] = None ,
113113 * ,
114+ diff : bool = False ,
114115 language : Optional [str ] = None
115116 ) -> str :
116117 logger .info ("performing rewriting of source (%s) using match template "
@@ -128,7 +129,8 @@ def rewrite(self,
128129 raise NotImplementedError ("args are not currently supported" )
129130
130131 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' ]
132134 cmd_s = ' ' .join (cmd )
133135
134136 return self .call (cmd_s , text = source )
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ def rewrite(self,
7474 rewrite : str ,
7575 args : Optional [Dict [str , str ]] = None ,
7676 * ,
77+ diff : bool = False ,
7778 language : Optional [str ] = None
7879 ) -> str :
7980 """
You can’t perform that action at this time.
0 commit comments