Apply argument comment lint across codex-rs

This commit is contained in:
Michael Bolin
2026-03-13 18:45:09 -07:00
parent 4e594bc93b
commit 2e751fd1d2
208 changed files with 1652 additions and 944 deletions
+23 -8
View File
@@ -92,20 +92,23 @@ impl Default for ConfigRequirements {
Self {
approval_policy: ConstrainedWithSource::new(
Constrained::allow_any_from_default(),
None,
/*source=*/ None,
),
sandbox_policy: ConstrainedWithSource::new(
Constrained::allow_any(SandboxPolicy::new_read_only_policy()),
None,
/*source=*/ None,
),
web_search_mode: ConstrainedWithSource::new(
Constrained::allow_any(WebSearchMode::Cached),
None,
/*source=*/ None,
),
feature_requirements: None,
mcp_servers: None,
exec_policy: None,
enforce_residency: ConstrainedWithSource::new(Constrained::allow_any(None), None),
enforce_residency: ConstrainedWithSource::new(
Constrained::allow_any(/*initial_value=*/ None),
/*source=*/ None,
),
network: None,
}
}
@@ -508,7 +511,10 @@ impl TryFrom<ConfigRequirementsWithSources> for ConfigRequirements {
})?;
ConstrainedWithSource::new(constrained, Some(requirement_source))
}
None => ConstrainedWithSource::new(Constrained::allow_any_from_default(), None),
None => ConstrainedWithSource::new(
Constrained::allow_any_from_default(),
/*source=*/ None,
),
};
// TODO(gt): `ConfigRequirementsToml` should let the author specify the
@@ -559,7 +565,10 @@ impl TryFrom<ConfigRequirementsWithSources> for ConfigRequirements {
ConstrainedWithSource::new(constrained, Some(requirement_source))
}
None => {
ConstrainedWithSource::new(Constrained::allow_any(default_sandbox_policy), None)
ConstrainedWithSource::new(
Constrained::allow_any(default_sandbox_policy),
/*source=*/ None,
)
}
};
let exec_policy = match rules {
@@ -612,7 +621,10 @@ impl TryFrom<ConfigRequirementsWithSources> for ConfigRequirements {
})?;
ConstrainedWithSource::new(constrained, Some(requirement_source))
}
None => ConstrainedWithSource::new(Constrained::allow_any(WebSearchMode::Cached), None),
None => ConstrainedWithSource::new(
Constrained::allow_any(WebSearchMode::Cached),
/*source=*/ None,
),
};
let feature_requirements =
feature_requirements.filter(|requirements| !requirements.value.is_empty());
@@ -638,7 +650,10 @@ impl TryFrom<ConfigRequirementsWithSources> for ConfigRequirements {
})?;
ConstrainedWithSource::new(constrained, Some(requirement_source))
}
None => ConstrainedWithSource::new(Constrained::allow_any(None), None),
None => ConstrainedWithSource::new(
Constrained::allow_any(/*initial_value=*/ None),
/*source=*/ None,
),
};
let network = network.map(|sourced_network| {
let Sourced { value, source } = sourced_network;
+4 -1
View File
@@ -142,7 +142,10 @@ pub async fn first_layer_config_error<T: DeserializeOwned>(
// per-file error to point users at a specific file and range rather than an
// opaque merged-layer failure.
first_layer_config_error_for_entries::<T, _>(
layers.get_layers(ConfigLayerStackOrdering::LowestPrecedenceFirst, false),
layers.get_layers(
ConfigLayerStackOrdering::LowestPrecedenceFirst,
/*include_disabled=*/ false,
),
config_toml_file,
)
.await
+12 -3
View File
@@ -211,7 +211,10 @@ impl ConfigLayerStack {
pub fn effective_config(&self) -> TomlValue {
let mut merged = TomlValue::Table(toml::map::Map::new());
for layer in self.get_layers(ConfigLayerStackOrdering::LowestPrecedenceFirst, false) {
for layer in self.get_layers(
ConfigLayerStackOrdering::LowestPrecedenceFirst,
/*include_disabled=*/ false,
) {
merge_toml_values(&mut merged, &layer.config);
}
merged
@@ -221,7 +224,10 @@ impl ConfigLayerStack {
let mut origins = HashMap::new();
let mut path = Vec::new();
for layer in self.get_layers(ConfigLayerStackOrdering::LowestPrecedenceFirst, false) {
for layer in self.get_layers(
ConfigLayerStackOrdering::LowestPrecedenceFirst,
/*include_disabled=*/ false,
) {
record_origins(&layer.config, &layer.metadata(), &mut path, &mut origins);
}
@@ -231,7 +237,10 @@ impl ConfigLayerStack {
/// Returns the highest-precedence to lowest-precedence layers, so
/// `ConfigLayerSource::SessionFlags` would be first, if present.
pub fn layers_high_to_low(&self) -> Vec<&ConfigLayerEntry> {
self.get_layers(ConfigLayerStackOrdering::HighestPrecedenceFirst, false)
self.get_layers(
ConfigLayerStackOrdering::HighestPrecedenceFirst,
/*include_disabled=*/ false,
)
}
/// Returns the highest-precedence to lowest-precedence layers, so