File: write_corrected_file.mli

package info (click to toggle)
ppx-expect 0.17.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: ml: 3,399; ansic: 104; javascript: 19; makefile: 15; sh: 2
file content (22 lines) | stat: -rw-r--r-- 696 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
open! Base
open Types

(** The callback expected by [f], which should convert the input to patches and is
    allowed to access the contents of the original file while doing so. *)
module Patch_with_file_contents : sig
  type 'a t = original_file_contents:string -> 'a -> (Compact_loc.t * string) list
end

(** Build a list of diffs to a file using [with_], then apply them to the file contents
    and write a [.corrected] file.

    Exported for use by toplevel tests. *)
val f
  :  use_color:bool
  -> in_place:bool
  -> diff_command:string option
  -> diff_path_prefix:string option
  -> filename:string
  -> with_:'a Patch_with_file_contents.t
  -> 'a
  -> Ppx_inline_test_lib.Test_result.t