Skip to content

Commit

Permalink
Add option for package v2
Browse files Browse the repository at this point in the history
Summary: As titled

Reviewed By: DavidSnider

Differential Revision: D56267634

fbshipit-source-id: f244706851fa9227b1230750223c80a23691a6c6
  • Loading branch information
Millie Chen authored and facebook-github-bot committed May 16, 2024
1 parent d45b3df commit 405a8e2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions hphp/hack/src/options/globalOptions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ type t = {
hack_warnings: bool;
tco_strict_switch: bool;
tco_allowed_files_for_ignore_readonly: string list;
tco_package_v2: bool;
}
[@@deriving eq, show]

Expand Down Expand Up @@ -277,6 +278,7 @@ let default =
hack_warnings = false;
tco_strict_switch = false;
tco_allowed_files_for_ignore_readonly = [];
tco_package_v2 = false;
}

let set
Expand Down Expand Up @@ -380,6 +382,7 @@ let set
?hack_warnings
?tco_strict_switch
?tco_allowed_files_for_ignore_readonly
?tco_package_v2
options =
let setting setting option =
match setting with
Expand Down Expand Up @@ -645,6 +648,7 @@ let set
setting
tco_allowed_files_for_ignore_readonly
options.tco_allowed_files_for_ignore_readonly;
tco_package_v2 = setting tco_package_v2 options.tco_package_v2;
}

let so_naming_sqlite_path t = t.so_naming_sqlite_path
Expand Down
3 changes: 3 additions & 0 deletions hphp/hack/src/options/globalOptions.mli
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ type t = {
tco_strict_switch: bool;
(** Enable strict case checking in switch statements *)
tco_allowed_files_for_ignore_readonly: string list;
tco_package_v2: bool;
(** Option to bypass package boundary violation errors to enable v0 of intern-prod separation *)
}
[@@deriving eq, show]

Expand Down Expand Up @@ -355,6 +357,7 @@ val set :
?hack_warnings:bool ->
?tco_strict_switch:bool ->
?tco_allowed_files_for_ignore_readonly:string list ->
?tco_package_v2:bool ->
t ->
t

Expand Down
3 changes: 2 additions & 1 deletion hphp/hack/src/oxidized/gen/global_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
//
// @generated SignedSource<<1a63932daec4cf591483d6eb89b43b4d>>
// @generated SignedSource<<e881f96f37620669b370c1733225d83e>>
//
// To regenerate this file, run:
// hphp/hack/src/oxidized_regen.sh
Expand Down Expand Up @@ -183,4 +183,5 @@ pub struct GlobalOptions {
pub hack_warnings: bool,
pub tco_strict_switch: bool,
pub tco_allowed_files_for_ignore_readonly: Vec<String>,
pub tco_package_v2: bool,
}
1 change: 1 addition & 0 deletions hphp/hack/src/oxidized/manual/global_options_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ impl Default for GlobalOptions {
hack_warnings: false,
tco_strict_switch: false,
tco_allowed_files_for_ignore_readonly: vec![],
tco_package_v2: false,
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const DEFAULT: GlobalOptions<'_> = GlobalOptions {
po_disallow_direct_superglobals_refs: false,
hack_warnings: false,
tco_allowed_files_for_module_declarations: vec![],
tco_package_v2: false,
};

impl GlobalOptions<'static> {
Expand Down
1 change: 1 addition & 0 deletions hphp/hack/src/utils/hh_config/hh_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ impl HhConfig {
tco_extended_reasons: default.tco_extended_reasons,
hack_warnings: hhconfig.get_bool_or("hack_warnings", default.hack_warnings)?,
tco_strict_switch: hhconfig.get_bool_or("strict_switch", default.tco_strict_switch)?,
tco_package_v2: hhconfig.get_bool_or("package_v2", default.tco_package_v2)?,
};
let mut c = Self {
local_config,
Expand Down

0 comments on commit 405a8e2

Please sign in to comment.