641: Allow whitespace on either side of main header delimiter #718
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #641
Why is this the best possible solution? Were any other approaches considered?
A user might put white space on either side of the double colon delimiter, so it's stripped off the tokens after splitting. Trailing or leading white space isn't needed either so it's stripped off both ends of the tokens.
What are the regression risks?
Low risk, it should just fix the problem in #641. I updated the code branch for single colons, because although that usage has been deprecated since what seems like 2012, it's different question to #641 (e.g. should code for the single colon case be removed? raise an error instead? or a warning? etc).
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No
Before submitting this PR, please make sure you have:
tests
python -m unittest
and verified all tests passruff format pyxform tests
andruff check pyxform tests
to lint code