Skip to content

Commit 2bb9143

Browse files
committed
docs: Improve Match docstring
1 parent 160b2a8 commit 2bb9143

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

pygitguardian/models.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,25 @@ def make_match(self, data: Dict[str, Any], **kwargs: Any) -> "Match":
185185

186186
class Match(Base, FromDictMixin):
187187
"""
188-
Match describes a found issue by GitGuardian.
189-
With info such as match location and type.
190-
Example:
191-
{ "match": "cake.gitguardian.com",
192-
"index_end": 96,
193-
"index_start": 77,
194-
"type": "host",
195-
"line_end": 2,
196-
"line_start": 2 }
188+
Match describes an issue found by GitGuardian.
189+
190+
Fields:
191+
192+
- match: the matched string
193+
194+
- match_type: the "label" of the matched string ("username", "password"...)
195+
196+
- index_start: 0-based index of the first character of the match inside the
197+
document.
198+
199+
- index_end: 0-based index of the last character of the match inside the
200+
document (not the index of the character after the last character!)
201+
202+
- line_start: 1-based index of the line where the first character of the
203+
match is.
204+
205+
- line_end: 1-based index of the line where the last character of the
206+
match is.
197207
"""
198208

199209
SCHEMA = MatchSchema()

0 commit comments

Comments
 (0)