Repository navigation
fix(config): name the file in evaluation errors that point at no source - #128
Conversation
pklr 5.2.1 type-checks properties set through an amendment, as Pkl does, so a wrong type in patchula.pkl now fails during evaluation instead of in the Count's own validation. Pkl's type errors carry no source, so the message lost the file. Evaluation errors without a source are now reported like the Count's own problems: the file, and the property when it is assigned once in it.
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Rust | Oct 31, 2026 5:03a.m. | Review ↗ | |
| JavaScript | Oct 31, 2026 5:03a.m. | Review ↗ | |
| Shell | Oct 31, 2026 5:03a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
All reported issues were addressed across 1 file
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Its message names the property but not its path, so a unique assignment of the same name elsewhere in the file could be the wrong one.
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
An empty pattern matches at every byte, and each match rescanned the rest of the source, for a span an empty name never gets.
Unblocks the pklr 5.2.2 update (#118). Its CI fails
invalid_values_have_actionable_diagnostics: forprs { dashboard = "yes" }the error no longer namespatchula.pkl.Cause. pklr 5.2.1 (jdx/pklr#339) rebuilds an amended inherited
new { … }property in its final scope. As a result it now type-checks a property set through an amendment, as Pkl does. With 5.2.0, a minimalprs { dashboard = "yes" }evaluated to{"prs":{"dashboard":"yes"}}with no error. pklr's type errors never carry a source span, even for a plaindashboard: Boolean = "yes"in one file. So the error now raised during evaluation pre-empts the Count's own validation, which used to name the file and point at the assignment. This is not a pklr bug: it is the correct behaviour, and we relied on its absence.Fix.
config::loadreports an evaluation error that has no source code the way the Count reports his own problems. It names the file, and highlights the property when it is assigned exactly once in it. Errors that already show their source, such as syntax errors, are unchanged.The
patchula-configtests pass with pklr 5.1.1 (main) and with 5.2.2, the latter checked through a local[patch.crates-io]that is not committed.