XLSForm / pyxform

A Python package to create XForms for ODK Collect.
BSD 2-Clause "Simplified" License
77 stars 134 forks source link

No warning unlabeled group 2 #545

Closed yanokwa closed 2 years ago

yanokwa commented 2 years ago

Too many warnings make it hard for users to see things they should be actually warned about. In this case, users use field-lists to visually group questions and that grouping really doesn't need a label, so we don't need to warn users.

And while I was looking at the warnings, I wanted to improve them by specifying that the warning was about a group or a repeat.

I also removed the warning for username and start-geopoint. The later, I'm not sure ever threw a warning.

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

Originally, I wanted to warn on every group and every repeat, but decided to dial it back because...

What are the regression risks?

There could be some downstream tools that rely on group labels, but since has always been a warning and not an error, it seems likely that those tools can handle missing group labels.

There doesn't seem to be a fixed list of acceptable ways to say "begin group". There is a regex in https://github.com/XLSForm/pyxform/blob/master/pyxform/xls2json.py#L570 that I built my tests around.

Finally, there isn't a lot of test coverage on groups, so that didn't make me feel great.

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

No, infact https://xlsform.org/en/#multiple-webpage-forms shows an example of a field-list without a label.

Before submitting this PR, please make sure you have:

codecov-commenter commented 2 years ago

Codecov Report

Merging #545 (551dc7f) into master (2e631b1) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #545   +/-   ##
=======================================
  Coverage   83.85%   83.85%           
=======================================
  Files          25       25           
  Lines        3747     3748    +1     
  Branches      875      875           
=======================================
+ Hits         3142     3143    +1     
  Misses        457      457           
  Partials      148      148           
Impacted Files Coverage Δ
pyxform/aliases.py 100.00% <ø> (ø)
pyxform/xls2json.py 78.56% <ø> (ø)
pyxform/constants.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2e631b1...551dc7f. Read the comment docs.