Skip to content

Commit d2248a0

Browse files
author
Sylvain MARIE
committed
Updated doc according to recent changes + minor docstring edit
1 parent d7dde74 commit d2248a0

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

docs/decorators/base_validation_lib.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,25 +86,25 @@ Validates that x is odd (`x % 2 != 0`).
8686

8787
## Collections
8888

89-
### has_length(ref_length)
89+
### empty
9090

91-
'length equals' validation function generator. Returns a validation_function to check that `len(x) == ref_length`
91+
'empty' validation function. Raises a `NotEmpty` error in case of failure.
9292

93-
### minlen(min_length, strict:bool=False)
93+
### non_empty
9494

95-
'Minimum length' validation function generator. Returns a validation function to check that `len(x) >= min_length` (strict=False, default) or `len(x) > min_length` (strict=True).
95+
'non empty' validation function. Raises a `Empty` error in case of failure.
9696

97-
### minlens(min_length)
97+
### has_length(ref_length)
9898

99-
Alias for minlen in strict mode.
99+
'length equals' validation function generator. Returns a validation_function to check that `len(x) == ref_length`
100100

101-
### maxlen(max_length, strict:bool=False)
101+
### minlen(min_length)
102102

103-
'Maximum length' validation function generator. Returns a validation function to check that `len(x) <= max_length` (strict=False, default) or `len(x) < max_length` (strict=True).
103+
'Minimum length' validation function generator. Returns a validation function to check that `len(x) >= min_length`.
104104

105-
### maxlens(max_length)
105+
### maxlen(max_length)
106106

107-
Alias for maxlen in strict mode.
107+
'Maximum length' validation function generator. Returns a validation function to check that `len(x) <= max_length`.
108108

109109
### length_between(min_len, max_len, open_left:bool=False, open_right:bool=False)
110110

valid8/validation_lib/collections.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(self, wrong_value):
1616

1717
def non_empty(x):
1818
"""
19-
'non empty' validation function. Raises a `Empty` error in case of validation failure.
19+
'non empty' validation function. Raises a `Empty` error in case of failure.
2020
"""
2121
if len(x) > 0:
2222
return True
@@ -33,7 +33,7 @@ def __init__(self, wrong_value):
3333

3434
def empty(x):
3535
"""
36-
'is empty' validation function. Raises a `NotEmpty` error in case of validation failure.
36+
'is empty' validation function. Raises a `NotEmpty` error in case of failure.
3737
"""
3838
if len(x) == 0:
3939
return True

0 commit comments

Comments
 (0)