Skip to content

Commit

Permalink
Make everything_sdt=true the default for hh_single_type_check
Browse files Browse the repository at this point in the history
Summary: As title says. Remove the `--everything-sdt` flag and make `true` its default setting. To override this, use `--config everything_sdt=false`. At the same time, remove `--enable-sound-dynamic-type` from test config files because it is also now the default.

Reviewed By: madgen

Differential Revision: D56759937

fbshipit-source-id: ad5113d4ea12d67ec2aba9dd7adaeffb1ed7229c
  • Loading branch information
Andrew Kennedy authored and facebook-github-bot committed May 16, 2024
1 parent 3e2cf16 commit 50f7db5
Show file tree
Hide file tree
Showing 177 changed files with 904 additions and 728 deletions.
4 changes: 0 additions & 4 deletions hphp/hack/src/hackrs/compare_folded_decls_file.ml
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ let () =
( "--interpret-soft-types-as-like-types",
Arg.Set interpret_soft_types_as_like_types,
"Interpret <<__Soft>> type hints as like types" );
( "--everything-sdt",
Arg.Set everything_sdt,
" Treat all classes, functions, and traits as though they are annotated with <<__SupportDynamicType>>, unless they are annotated with <<__NoAutoDynamic>>"
);
( "--enable-strict-const-semantics",
Arg.Int (fun x -> enable_strict_const_semantics := x),
" Raise an error when a concrete constants is overridden or multiply defined"
Expand Down
5 changes: 0 additions & 5 deletions hphp/hack/src/hh_single_decl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,6 @@ let () =
( "--interpret-soft-types-as-like-types",
Arg.Set interpret_soft_types_as_like_types,
"Interpret <<__Soft>> type hints as like types" );
( "--everything-sdt",
Arg.Set everything_sdt,
" Treat all classes, functions, and traits as though they are annotated with <<__SupportDynamicType>>, unless they are annotated with <<__NoAutoDynamic>>"
);
( "--rust-provider-backend",
Arg.Set rust_provider_backend,
" Use the Rust implementation of Provider_backend (including decl-folding)"
Expand Down Expand Up @@ -531,7 +527,6 @@ let () =
ignored_flag "--require-extends-implements-ancestors";
ignored_flag "--strict-value-equality";
ignored_flag "--enable-sealed-subclasses";
ignored_flag "--enable-sound-dynamic-type";
ignored_arg "--explicit-consistent-constructors";
ignored_arg "--require-types-class-consts";
ignored_flag "--skip-tast-checks";
Expand Down
13 changes: 1 addition & 12 deletions hphp/hack/src/hh_single_type_check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ let parse_options () =
let sharedmem_config = ref SharedMem.default_config in
let print_position = ref true in
let enforce_sealed_subclasses = ref false in
let everything_sdt = ref false in
let custom_hhi_path = ref None in
let force_allow_builtins_in_custom_hhi_path = ref false in
let explicit_consistent_constructors = ref 0 in
Expand Down Expand Up @@ -558,7 +557,6 @@ let parse_options () =
Arg.Unit
(fun () ->
set_bool_ enable_sound_dynamic ();
set_bool_ everything_sdt ();
set_bool_ always_pessimise_return ();
set_bool_ consider_type_const_enforceable ();
set_bool_ enable_supportdyn_hint ()),
Expand All @@ -567,7 +565,6 @@ let parse_options () =
Arg.Unit
(fun () ->
set_bool_ enable_sound_dynamic ();
set_bool_ everything_sdt ();
set_bool_ enable_supportdyn_hint ()),
" Enables implicit pessimisation" );
( "--explicit-pess",
Expand Down Expand Up @@ -721,10 +718,6 @@ let parse_options () =
( "--enable-sealed-subclasses",
Arg.Set enforce_sealed_subclasses,
" Require all __Sealed arguments to be subclasses" );
( "--everything-sdt",
Arg.Set everything_sdt,
" Treat all classes, functions, and traits as though they are annotated with <<__SupportDynamicType>>, unless they are annotated with <<__NoAutoDynamic>>"
);
( "--custom-hhi-path",
Arg.String (fun s -> custom_hhi_path := Some s),
" Use custom hhis" );
Expand Down Expand Up @@ -849,10 +842,6 @@ let parse_options () =
config
|> Config_file.Getters.string_opt "allowed_fixme_codes_strict"
|> Option.map ~f:comma_string_to_iset;
everything_sdt :=
config
|> Config_file.Getters.bool_opt "everything_sdt"
|> Option.value ~default:!everything_sdt;
enable_sound_dynamic :=
config
|> Config_file.Getters.bool_opt "enable_sound_dynamic_type"
Expand Down Expand Up @@ -907,7 +896,7 @@ let parse_options () =
auto_namespace_map = !auto_namespace_map >?? default.auto_namespace_map;
deregister_php_stdlib =
!deregister_attributes >?? default.deregister_php_stdlib;
everything_sdt = !everything_sdt;
everything_sdt = true;
enable_class_level_where_clauses = !enable_class_level_where_clauses;
union_intersection_type_hints = !union_intersection_type_hints;
disallow_silence = !disallow_silence;
Expand Down
1 change: 1 addition & 0 deletions hphp/hack/test/count_imprecise_types/dune
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
.php
--flags
--count-imprecise-types
--config everything_sdt=false
--error-format
plain)))

Expand Down
2 changes: 1 addition & 1 deletion hphp/hack/test/deps/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--dump-deps --no-builtins --enable-sound-dynamic-type --everything-sdt
--dump-deps --no-builtins
2 changes: 1 addition & 1 deletion hphp/hack/test/deregister/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--deregister-attributes --enable-sound-dynamic-type --everything-sdt
--deregister-attributes
2 changes: 1 addition & 1 deletion hphp/hack/test/dump_inheritance/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--dump-inheritance --enable-sound-dynamic-type --everything-sdt
--dump-inheritance
2 changes: 1 addition & 1 deletion hphp/hack/test/dumpsymbolinfo/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--dump-symbol-info --enable-sound-dynamic-type --everything-sdt
--dump-symbol-info
1 change: 0 additions & 1 deletion hphp/hack/test/enum_supertyping/typing/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
--enable-sound-dynamic-type --everything-sdt
2 changes: 1 addition & 1 deletion hphp/hack/test/error_formatting/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --error-format context
--error-format context
2 changes: 1 addition & 1 deletion hphp/hack/test/error_formatting_highlighted/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --error-format highlighted
--error-format highlighted
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --error-format highlighted
--error-format highlighted
1 change: 1 addition & 0 deletions hphp/hack/test/extended_reasons/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--allowed-fixme-codes-strict 1002,2049,2053,2063,2121,4009,4029,4030,4051,4054,4055,4064,4090,4101,4102,4110,4123,4128,4323,4338,4341,9999,4107
--allowed-decl-fixme-codes 1002,2049,2053,4030,4054,4101,4338,4341
--config everything_sdt=false
--extended-reasons --config --union-intersection-type-hints --extended-reasons
2 changes: 1 addition & 1 deletion hphp/hack/test/find_local/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --find-local
--find-local
2 changes: 1 addition & 1 deletion hphp/hack/test/find_refs/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --find-refs
--find-refs
2 changes: 1 addition & 1 deletion hphp/hack/test/go_to_impl/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --go-to-impl
--go-to-impl
2 changes: 1 addition & 1 deletion hphp/hack/test/highlight_refs/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --highlight-refs
--highlight-refs
2 changes: 0 additions & 2 deletions hphp/hack/test/holes/dune
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
--fallback-expect-extension
.exp
--flags
--enable-sound-dynamic-type
--everything-sdt
--tast
--error-format
plain)))
Expand Down
1 change: 1 addition & 0 deletions hphp/hack/test/ide_code_actions/extract_method/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--config everything_sdt=false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--config everything_sdt=false
2 changes: 1 addition & 1 deletion hphp/hack/test/identify_symbol/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
--enable-sound-dynamic-type --everything-sdt --identify-symbol
--identify-symbol
1 change: 1 addition & 0 deletions hphp/hack/test/lint/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--lint
--error-format raw
--extra-builtin ../hhi/XHPTest.hhi
--config everything_sdt=false
1 change: 0 additions & 1 deletion hphp/hack/test/lint/implicit_pess/HH_FLAGS
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
--lint
--error-format raw
--extra-builtin ../../hhi/XHPTest.hhi
--implicit-pess
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"tast_hashes": {
"tast_hashes_test.php": {
"tast_hashes": {
"class_tast_hashes": { "\\A": 586315070, "\\B": 793583763 },
"class_tast_hashes": { "\\A": 640719681, "\\B": 129984708 },
"gconst_tast_hashes": { "\\B": 721695479 }
},
"error_hashes": []
Expand Down

0 comments on commit 50f7db5

Please sign in to comment.