Skip to content

Commit 59de35b

Browse files
committed
Deprecate config() convert parameter
1 parent 197edd0 commit 59de35b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ and this project adheres to Semantic Versioning (https://semver.org/spec/v2.0.0.
1212

1313
- `config()` now supports `checks` parameter for validation functions, matching `io()`.
1414

15+
### Changed
16+
17+
- `config()` parameter `convert` is now deprecated and emits a warning.
18+
1519
## [0.3.51] - 2026-03-04
1620

1721
### Changed

crates/pcb-zen-core/src/lang/module.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,21 @@ pub fn module_globals(builder: &mut GlobalsBuilder) {
18451845
#[starlark(require = named)] help: Option<String>,
18461846
eval: &mut Evaluator<'v, '_, '_>,
18471847
) -> starlark::Result<Value<'v>> {
1848+
// Warn if deprecated `convert` parameter is used
1849+
if convert.is_some() {
1850+
let (path, span) = eval
1851+
.call_stack_top_location()
1852+
.map(|loc| (loc.file.filename().to_string(), Some(loc.resolve_span())))
1853+
.unwrap_or_else(|| (eval.source_path().unwrap_or_default(), None));
1854+
let msg =
1855+
"config() parameter `convert` is deprecated and will be removed in a future release"
1856+
.to_string();
1857+
let mut diag = EvalMessage::from_any_error(Path::new(&path), &msg);
1858+
diag.span = span;
1859+
diag.severity = starlark::errors::EvalSeverity::Warning;
1860+
eval.add_diagnostic(diag);
1861+
}
1862+
18481863
// Config defaults imply optional input unless explicitly overridden.
18491864
let is_optional = optional.unwrap_or(default.is_some());
18501865

0 commit comments

Comments
 (0)