forked from facebook/pyre-check
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyrePath.mli
93 lines (56 loc) · 1.94 KB
/
pyrePath.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
(* Copyright (c) 2016-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. *)
open Core
type path = string [@@deriving compare, eq, show, sexp, hash]
module AbsolutePath : sig
type t [@@deriving compare, eq, show, sexp, hash]
end
module RelativePath : sig
type t [@@deriving compare, eq, show, sexp, hash]
val relative : t -> path
end
type t =
| Absolute of AbsolutePath.t
| Relative of RelativePath.t
[@@deriving compare, eq, show, sexp, hash, to_yojson]
val absolute : t -> path
val relative : t -> path option
val uri : t -> path
val last : t -> path
val create_absolute : ?follow_symbolic_links:bool -> path -> t
val create_relative : root:t -> relative:path -> t
val get_relative_to_root : root:t -> path:t -> path option
val from_uri : path -> t option
val current_working_directory : unit -> t
val append : t -> element:path -> t
module AppendOperator : sig
val ( ^| ) : t -> path -> t
end
val real_path : t -> t
val follow_symbolic_link : t -> t option
val is_directory : t -> bool
val is_path_python_stub : string -> bool
val is_path_python_init : string -> bool
val is_python_stub : t -> bool
val is_python_init : t -> bool
val file_exists : t -> bool
val list
: ?file_filter:(string -> bool) ->
?directory_filter:(string -> bool) ->
root:t ->
unit ->
t list
val directory_contains : directory:t -> t -> bool
val search_upwards : target:string -> root:t -> t option
val remove : t -> unit
val readlink : t -> path option
module Map : Map.S with type Key.t = t
module Set : Set.S with type Elt.t = t
val build_symlink_map : links:t list -> t Map.t
val with_suffix : t -> suffix:string -> t
val get_directory : t -> t
val project_directory : local_root:string -> filter_directories:string list -> string
(* paths can be files or directories *)
val get_matching_files_recursively : suffix:string -> paths:t list -> t list