Skip to content

534: Require labels for items in choice lists - #875

Open
lindsay-stevens wants to merge 2 commits into
XLSForm:masterfrom
lindsay-stevens:pyxform-534
Open

lindsay-stevens wants to merge 2 commits into
XLSForm:masterfrom
lindsay-stevens:pyxform-534

Conversation

@lindsay-stevens

Copy link
Copy Markdown
Contributor

Closes #534

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

As discussed in the issue.

What are the regression risks?

Forms that ignored the warning and did not use Validate, will now be rejected by pyxform.

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

No, the docs don't tend to explicitly say which columns are required and don't say that a label is optional, but example forms and the template consistently show choices with a label of some kind. In the XForms 1.0 XSD a label is required for a choices item.

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

- previously showed a pyxform warning for no label, then an ODK validate
  error; now there's a pyxform error for no label and media.
- in clean_text_values, skip regex if the maybe_strip result is empty
- for PyXFormErrors using ErrorCode, use the code/context pattern
  instead of pre-formatting the message string (used for warnings).
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.

Require labels for items in choice lists

1 participant