Skip to content

fix(config): name the file in evaluation errors that point at no source - #128

Merged
sweepies merged 3 commits into
mainfrom
fix/config-eval-errors-name-the-file
Oct 31, 2026
Merged

sweepies merged 3 commits into
mainfrom
fix/config-eval-errors-name-the-file

Conversation

@sweepies

@sweepies sweepies commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Unblocks the pklr 5.2.2 update (#118). Its CI fails invalid_values_have_actionable_diagnostics: for prs { dashboard = "yes" } the error no longer names patchula.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 minimal prs { dashboard = "yes" } evaluated to {"prs":{"dashboard":"yes"}} with no error. pklr's type errors never carry a source span, even for a plain dashboard: 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::load reports 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-config tests 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.

View guided diff Turn on auto-fix

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.
@deepsource-io

deepsource-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 02af8b3...a989757 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread crates/config/src/lib.rs Resolved
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.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread crates/config/src/lib.rs Resolved
An empty pattern matches at every byte, and each match rescanned the rest
of the source, for a span an empty name never gets.
@sweepies
sweepies merged commit 77c5309 into main Oct 31, 2026
16 checks passed
@sweepies
sweepies deleted the fix/config-eval-errors-name-the-file branch October 31, 2026 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant