MCPcopy Index your code
hub / github.com/python/mypy / underline_link

Method underline_link

mypy/util.py:836–846  ·  view source on GitHub ↗

Underline a link in a note message (if any). This assumes there is at most one link in the message.

(self, note: str)

Source from the content-addressed store, hash-verified

834 return out
835
836 def underline_link(self, note: str) -> str:
837 """Underline a link in a note message (if any).
838
839 This assumes there is at most one link in the message.
840 """
841 match = re.search(r"https?://\S*", note)
842 if not match:
843 return note
844 start = match.start()
845 end = match.end()
846 return note[:start] + self.style(note[start:end], "none", underline=True) + note[end:]
847
848 def format_success(self, n_sources: int, use_color: bool = True) -> str:
849 """Format short summary in case of success.

Callers 1

colorizeMethod · 0.95

Calls 1

styleMethod · 0.95

Tested by

no test coverage detected