-
Notifications
You must be signed in to change notification settings - Fork 321
Closed
Description
As discussed in pypa/readme_renderer#231
Here's the custom class:
Lines 51 to 71 in a6dd69c
class _WarningStream: | |
def __init__(self) -> None: | |
self.output = io.StringIO() | |
def write(self, text: str) -> None: | |
matched = _REPORT_RE.search(text) | |
if not matched: | |
self.output.write(text) | |
return | |
self.output.write( | |
"line {line}: {level_text}: {message}\n".format( | |
level_text=matched.group("level").capitalize(), | |
line=matched.group("line"), | |
message=matched.group("message").rstrip("\r\n"), | |
) | |
) | |
def __str__(self) -> str: | |
return self.output.getvalue().strip() |
@bhrutledge has some ideas on how to replace the usage to better reflect the future interaction of twine check and readme_renderer
when docutils
doesn't pass a warning, but readme_renderer
does.
Metadata
Metadata
Assignees
Labels
No labels