Skip to content

Commit

Permalink
Add missing -corrected-suffix option (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiedimino authored and Jeremie Dimino committed Jun 1, 2018
1 parent 01bf0ff commit b69b1a4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.2.1
-----

- Allow to set the suffix of corrected files

0.2.0
-----

Expand Down
5 changes: 4 additions & 1 deletion src/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ let diff_command = ref Options.diff_command
let pretty = ref false
let styler = ref None
let output_metadata_filename = ref None
let corrected_suffix = ref ".ppx-corrected"

module Lint_error = struct
type t = Location.t * string
Expand Down Expand Up @@ -869,7 +870,7 @@ let process_file (kind : Kind.t) fn ~input_name ~output_mode ~embed_errors ~outp
|> String.concat ~sep:""));

let input_contents = lazy (load_source_file fn) in
let corrected = fn ^ ".ppx-corrected" in
let corrected = fn ^ !corrected_suffix in
let mismatches_found =
match !corrections with
| [] ->
Expand Down Expand Up @@ -1119,6 +1120,8 @@ let standalone_args =
" Same as -cookie"
; "-output-metadata", Arg.String (fun s -> output_metadata_filename := Some s),
"FILE Where to store the output metadata"
; "-corrected-suffix", Arg.Set_string corrected_suffix,
"SUFFIX Suffix to happend to corrected files"
]
;;

Expand Down

0 comments on commit b69b1a4

Please sign in to comment.