Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / function

web_file_url

codeintel.git_source.web_file_url

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Called by (2)
SymbolFileResolved by
hit_to_dictcontext.pythrough an import
web_urlgit_source.pysame file
Inside (1)
SymbolFileResolved by
git_sourcegit_source.pysame file
codeintel.git_source.web_file_urlbackend/app/codeintel/git_source.py, lines 108–118Open source
def web_file_url(canonical_url: str, commit: str, path: str, start: int | None, end: int | None) -> str | None:    parts = urlsplit(canonical_url)    if parts.scheme != "https":        return None    if parts.hostname == "github.com":        anchor = f"#L{start}-L{end}" if start and end else ""        return f"{canonical_url}/blob/{commit}/{path}{anchor}"    if parts.hostname == "gitlab.com":        anchor = f"#L{start}-{end}" if start and end else ""        return f"{canonical_url}/-/blob/{commit}/{path}{anchor}"    return None

What the index recorded

Signature
def web_file_url(canonical_url: str, commit: str, path: str, start: int | None, end: int | None) -> str | None:
File
backend/app/codeintel/git_source.py
Lines
108–118
Parser
python-ast
Git blob
6f88470169e4935929c5f865a974bd86da564c1a
Call sites
1 named, 0 resolved, 1 left unlinked

Read it on GitHub at this commit