Skip to content

862: clarify/normalise "variable reference ('${name}')" error messages - #873

Merged
lindsay-stevens merged 1 commit into
XLSForm:masterfrom
lindsay-stevens:pyxform-862
Oct 6, 2026
Merged

lindsay-stevens merged 1 commit into
XLSForm:masterfrom
lindsay-stevens:pyxform-862

Conversation

@lindsay-stevens

Copy link
Copy Markdown
Contributor

Closes #862
Related to #634

Why is this the best possible solution? Were any other approaches considered?

The errors and terminology for this feature are a bit nebulous so I've tried to normalise them all in one go. There is existing test coverage for the errors that use these messages (the tests purposely don't rely on the exact message wording) so no tests are changed. Further details are in the commit message.

What are the regression risks?

Downstream tools expecting the old messages would need to be updated to the new messages. It might help to include the error message identifier at some stage but currently they aren't stable enough for that.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

Maybe - on xlsform.org this feature isn't given a name or explicitly documented, it's just used as part of other sections.

Before submitting this PR, please make sure you have:

  • included test cases for core behavior and edge cases in tests
  • run python -m unittest and verified all tests pass
  • run ruff format pyxform tests and ruff check pyxform tests to lint code
  • verified that any code or assets from external sources are properly credited in comments

- consistently use "variable reference ('${name}')" to clarify what
  feature these errors are about.
  - the variable reference feature resolves any name from the survey
    sheet to XPath, including questions/fields or repeat/display groups,
    so the terms 'question name', 'field name' are avoided.
  - survey 'name' column values are sometimes referred to as 'variables'
    and these tokens are "references to variables", but the term
    "reference variables" could imply a special type of variable, so
    the term "variable reference" is used. The ODK docs refer to this
    feature as just "Variables" and so "variable references" separates
    this syntax from a survey 'name' column value.
  - docs also refer to this feature as '${} notation' but that seemed
    like it may be confused with a token substitution error or something
    technical; however to further disambiguate the above point, the
    example string `('${name}')` is appended to show the syntax and
    highlight that the value inside the braces must be a name.
- add include a "Learn more" link to the docs where relevant.
- add error message guideline in ErrorCode docstring.
@lindsay-stevens lindsay-stevens changed the title chg: clarify/normalise "variable reference ('${name}')" error messages 862: clarify/normalise "variable reference ('${name}')" error messages Oct 2, 2026
@lindsay-stevens
lindsay-stevens merged commit b7724a4 into XLSForm:master Oct 6, 2026
14 checks passed
@lindsay-stevens
lindsay-stevens deleted the pyxform-862 branch October 6, 2026 06:59
@lindsay-stevens lindsay-stevens mentioned this pull request Oct 6, 2026
4 tasks done
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.

Simplify language for missing ${} reference error

2 participants