@@ -199,6 +199,9 @@ pub struct ConfigToml {
199199 /// Sandbox mode to use.
200200 pub sandbox_mode : Option < SandboxMode > ,
201201
202+ /// Treat every project directory as trusted.
203+ pub trust_all_projects : Option < bool > ,
204+
202205 /// Sandbox configuration to apply if `sandbox` is `WorkspaceWrite`.
203206 pub sandbox_workspace_write : Option < SandboxWorkspaceWrite > ,
204207
@@ -826,6 +829,12 @@ impl ConfigToml {
826829 resolved_cwd : & Path ,
827830 repo_root : Option < & Path > ,
828831 ) -> Option < ProjectConfig > {
832+ if self . trust_all_projects . unwrap_or ( false ) {
833+ return Some ( ProjectConfig {
834+ trust_level : Some ( TrustLevel :: Trusted ) ,
835+ } ) ;
836+ }
837+
829838 let projects = self . projects . as_ref ( ) ?;
830839
831840 for normalized_cwd in normalized_project_lookup_keys ( resolved_cwd) {
@@ -1018,4 +1027,15 @@ mod tests {
10181027 assert ! ( message. contains( "TOML list of strings" ) ) ;
10191028 assert ! ( message. contains( "comma-separated strings are not supported" ) ) ;
10201029 }
1030+
1031+ #[ test]
1032+ fn trust_all_projects_marks_any_directory_trusted ( ) {
1033+ let config: ConfigToml = toml:: from_str ( "trust_all_projects = true" )
1034+ . expect ( "trust_all_projects should deserialize" ) ;
1035+ let active_project = config
1036+ . get_active_project ( Path :: new ( "/tmp/anything" ) , None )
1037+ . expect ( "trust_all_projects should always resolve an active project" ) ;
1038+
1039+ assert_eq ! ( active_project. trust_level, Some ( TrustLevel :: Trusted ) ) ;
1040+ }
10211041}
0 commit comments