Fix strip whitespace ordering #264
Merged
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.
if self.strip_whitespace {}
code to before the minimum and maximum length checks.Err('String should have at most 5 characters')
to'1234'
for input'1234 '
, since thestrip_whitespace
code will now remove the spaces before the input gets to the length checks, changing the input string to 4 characters instead of 6 characters. Therefore, the input should now pass the length validation instead of throwing an error.({'strip_whitespace': True, 'pattern': r'\d+$'}, 'foobar 123 ', Err("String should match pattern '\\d+$'"))
to'foobar 123'
since thestrip_whitespace
now removes the trailing' '
, so the input should pass the pattern validation since a digit will be the last character in the string.