Skip to content

Commit d7e301a

Browse files
grievejiafacebook-github-bot
authored andcommitted
Remove ignore_infer configuration option
Reviewed By: stroxler Differential Revision: D30196050 fbshipit-source-id: 6ea60351dfc4f6c674798195959dff3519e3e560
1 parent 9cf6fa6 commit d7e301a

File tree

10 files changed

+8
-88
lines changed

10 files changed

+8
-88
lines changed

source/command/inferCommand.ml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ let argument_to_paths argument =
1717

1818

1919
let run_infer_interprocedural
20-
ignore_infer
20+
_ignore_infer
2121
_verbose
2222
expected_version
2323
sections
@@ -59,7 +59,6 @@ let run_infer_interprocedural
5959
~project_root
6060
();
6161
Profiling.GlobalState.initialize ?profiling_output ?memory_profiling_output ();
62-
let ignore_infer = argument_to_paths ignore_infer in
6362
let filter_directories = argument_to_paths filter_directories in
6463
let ignore_all_errors = argument_to_paths ignore_all_errors in
6564
let configuration =
@@ -77,7 +76,6 @@ let run_infer_interprocedural
7776
~excludes
7877
~extensions:(List.map ~f:Configuration.Extension.create_extension extensions)
7978
?log_directory
80-
?ignore_infer
8179
?python_major_version
8280
?python_minor_version
8381
?python_micro_version
@@ -160,7 +158,7 @@ let run_infer_interprocedural
160158

161159

162160
let run_infer_local
163-
ignore_infer
161+
_ignore_infer
164162
_verbose
165163
expected_version
166164
sections
@@ -202,7 +200,6 @@ let run_infer_local
202200
~project_root
203201
();
204202
Profiling.GlobalState.initialize ?profiling_output ?memory_profiling_output ();
205-
let ignore_infer = argument_to_paths ignore_infer in
206203
let filter_directories = argument_to_paths filter_directories in
207204
let ignore_all_errors = argument_to_paths ignore_all_errors in
208205
let configuration =
@@ -220,7 +217,6 @@ let run_infer_local
220217
~excludes
221218
~extensions:(List.map ~f:Configuration.Extension.create_extension extensions)
222219
?log_directory
223-
?ignore_infer
224220
?python_major_version
225221
?python_minor_version
226222
?python_micro_version

source/command/newInferCommand.ml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ module InferConfiguration = struct
3838
excludes: string list;
3939
checked_directory_allowlist: Path.t list;
4040
checked_directory_blocklist: Path.t list;
41-
ignore_infer: Path.t list;
4241
extensions: Configuration.Extension.t list;
4342
(* Auxiliary paths *)
4443
log_path: Path.t;
@@ -85,7 +84,6 @@ module InferConfiguration = struct
8584
let checked_directory_blocklist =
8685
json |> path_list_member "checked_directory_blocklist" ~default:[]
8786
in
88-
let ignore_infer = json |> path_list_member "ignore_infer" ~default:[] in
8987
let extensions =
9088
json
9189
|> string_list_member "extensions" ~default:[]
@@ -131,7 +129,6 @@ module InferConfiguration = struct
131129
excludes;
132130
checked_directory_allowlist;
133131
checked_directory_blocklist;
134-
ignore_infer;
135132
extensions;
136133
log_path;
137134
global_root;
@@ -160,7 +157,6 @@ module InferConfiguration = struct
160157
excludes;
161158
checked_directory_allowlist;
162159
checked_directory_blocklist;
163-
ignore_infer;
164160
extensions;
165161
log_path;
166162
global_root;
@@ -183,7 +179,6 @@ module InferConfiguration = struct
183179
| Buck { Configuration.Buck.artifact_root; _ } -> [SearchPath.Root artifact_root]
184180
in
185181
Configuration.Analysis.create
186-
~ignore_infer
187182
~parallel
188183
~analyze_external_sources:false
189184
~filter_directories:checked_directory_allowlist

source/command/newInferCommand.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ module InferConfiguration : sig
2121
excludes: string list;
2222
checked_directory_allowlist: PyrePath.t list;
2323
checked_directory_blocklist: PyrePath.t list;
24-
ignore_infer: PyrePath.t list;
2524
extensions: Configuration.Extension.t list;
2625
log_path: PyrePath.t;
2726
global_root: PyrePath.t;

source/command/test/newInferTest.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ let test_json_parsing context =
3737
"excludes": ["/excludes"],
3838
"checked_directory_allowlist": ["/allows"],
3939
"checked_directory_blocklist": ["/blocks"],
40-
"ignore_infer": ["/ignored"],
4140
"extensions": [".typsy"],
4241
"infer_mode": ["Local"],
4342
"debug": true,
@@ -68,7 +67,6 @@ let test_json_parsing context =
6867
excludes = ["/excludes"];
6968
checked_directory_allowlist = [Path.create_absolute "/allows"];
7069
checked_directory_blocklist = [Path.create_absolute "/blocks"];
71-
ignore_infer = [Path.create_absolute "/ignored"];
7270
extensions = [Configuration.Extension.create_extension ".typsy"];
7371
log_path = Path.create_absolute "/log";
7472
global_root = Path.create_absolute "/project";

source/configuration.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ module Analysis = struct
277277
include_hints: bool;
278278
perform_autocompletion: bool;
279279
features: Features.t;
280-
ignore_infer: Path.t list;
281280
log_directory: Path.t;
282281
python_major_version: int;
283282
python_minor_version: int;
@@ -313,7 +312,6 @@ module Analysis = struct
313312
?(include_hints = false)
314313
?(perform_autocompletion = false)
315314
?(features = Features.default)
316-
?(ignore_infer = [])
317315
?log_directory
318316
?(python_major_version = default_python_major_version)
319317
?(python_minor_version = default_python_minor_version)
@@ -353,7 +351,6 @@ module Analysis = struct
353351
include_hints;
354352
perform_autocompletion;
355353
features;
356-
ignore_infer;
357354
log_directory =
358355
(match log_directory with
359356
| Some directory -> Path.create_absolute directory

source/configuration.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ module Analysis : sig
118118
include_hints: bool;
119119
perform_autocompletion: bool;
120120
features: Features.t;
121-
ignore_infer: Path.t list;
122121
log_directory: Path.t;
123122
python_major_version: int;
124123
python_minor_version: int;
@@ -149,7 +148,6 @@ module Analysis : sig
149148
?include_hints:bool ->
150149
?perform_autocompletion:bool ->
151150
?features:Features.t ->
152-
?ignore_infer:Path.t list ->
153151
?log_directory:string ->
154152
?python_major_version:int ->
155153
?python_minor_version:int ->

source/interprocedural_analyses/type_inference/test/typeInferenceGlobalTest.ml

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -295,57 +295,12 @@ let attribute_widen_test context =
295295
()
296296
297297
298-
let ignore_infer_test context =
299-
let assert_fixpoint_result =
300-
assert_fixpoint_result
301-
~context
302-
~sources:["test.py", {|
303-
x = 1 + 1
304-
|}]
305-
~callable_names:["test.$toplevel"]
306-
in
307-
assert_fixpoint_result
308-
~expected:
309-
{|
310-
{
311-
"globals": [
312-
{
313-
"name": "x",
314-
"location": { "qualifier": "test", "path": "test.py", "line": 2 },
315-
"annotation": "int"
316-
}
317-
],
318-
"attributes": [],
319-
"defines": []
320-
}
321-
|}
322-
();
323-
assert_fixpoint_result
324-
~transform_configuration:(fun configuration ->
325-
{
326-
configuration with
327-
Configuration.Analysis.ignore_infer =
328-
[PyrePath.create_relative ~root:configuration.local_root ~relative:"test.py"];
329-
})
330-
~expected:
331-
{|
332-
{
333-
"globals": [],
334-
"attributes": [],
335-
"defines": []
336-
}
337-
|}
338-
();
339-
()
340-
341-
342298
let () =
343299
"typeInferenceAnalysisTest"
344300
>::: [
345301
"serialization" >:: serialization_test;
346302
"duplicates" >:: duplicate_define_test;
347303
"suppress" >:: suppress_test;
348304
"attribute_widen" >:: attribute_widen_test;
349-
"ignore_infer" >:: ignore_infer_test;
350305
]
351306
|> Test.run

source/interprocedural_analyses/type_inference/typeInferenceAnalysis.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* LICENSE file in the root directory of this source tree.
66
*)
77

8-
open Core
98
open Analysis
109
open Interprocedural
1110

@@ -33,8 +32,7 @@ module Analyzer = struct
3332
let maybe_source = AstEnvironment.ReadOnly.get_processed_source ast_environment qualifier in
3433
let result =
3534
match maybe_source with
36-
| Some ({ Ast.Source.source_path; _ } as source)
37-
when not (TypeInferenceLocal.skip_infer ~configuration source_path) ->
35+
| Some source ->
3836
TypeInferenceLocal.infer_for_define
3937
~configuration
4038
~global_resolution

source/interprocedural_analyses/type_inference/typeInferenceLocal.ml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -972,17 +972,6 @@ let legacy_infer_for_define
972972
[]
973973

974974

975-
let skip_infer
976-
~configuration:({ Configuration.Analysis.ignore_infer; _ } as configuration)
977-
source_path
978-
=
979-
try
980-
let path = Ast.SourcePath.full_path ~configuration source_path in
981-
source_path.is_stub or List.exists ignore_infer ~f:(Path.equal path)
982-
with
983-
| Unix.Unix_error (Unix.ENOENT, _, _) -> true
984-
985-
986975
let infer_for_define ~configuration ~global_resolution ~source ~qualifier ~define =
987976
let abstract =
988977
let { Node.value = { Define.signature; _ }; _ } = define in
@@ -1028,11 +1017,8 @@ let infer_for_module
10281017
~global_resolution
10291018
~source:({ Ast.Source.source_path = { qualifier; _ } as source_path; _ } as source)
10301019
=
1031-
if skip_infer ~configuration source_path then
1032-
[]
1033-
else (
1034-
Log.debug "Running infer for %s..." source_path.relative;
1035-
let check define =
1036-
infer_for_define ~configuration ~global_resolution ~source ~qualifier ~define
1037-
in
1038-
source |> Preprocessing.defines ~include_toplevels:true |> List.map ~f:check)
1020+
Log.debug "Running infer for %s..." source_path.relative;
1021+
let check define =
1022+
infer_for_define ~configuration ~global_resolution ~source ~qualifier ~define
1023+
in
1024+
source |> Preprocessing.defines ~include_toplevels:true |> List.map ~f:check

source/interprocedural_analyses/type_inference/typeInferenceLocal.mli

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ end
2929

3030
module State (Context : Context) : Signature
3131

32-
val skip_infer : configuration:Configuration.Analysis.t -> Ast.SourcePath.t -> bool
33-
3432
val infer_for_define
3533
: configuration:Configuration.Analysis.t ->
3634
global_resolution:Analysis.GlobalResolution.t ->

0 commit comments

Comments
 (0)