( file: string, position: SourceFileLocation['position'], )
| 160 | } |
| 161 | |
| 162 | export function formatGitLabLink( |
| 163 | file: string, |
| 164 | position: SourceFileLocation['position'], |
| 165 | ): string { |
| 166 | const baseUrl = getGitLabBaseUrl(); |
| 167 | if (!position) { |
| 168 | return `${baseUrl}/${file}`; |
| 169 | } |
| 170 | const { startLine, endLine } = position; |
| 171 | const lineRange = |
| 172 | endLine && startLine !== endLine ? `${startLine}-${endLine}` : startLine; |
| 173 | return `${baseUrl}/${file}#L${lineRange}`; |
| 174 | } |
| 175 | |
| 176 | export function formatFileLink( |
| 177 | file: string, |
no test coverage detected