MCPcopy Create free account
hub / github.com/code-pushup/cli / formatGitLabLink

Function formatGitLabLink

packages/utils/src/lib/reports/formatting.ts:162–174  ·  view source on GitHub ↗
(
  file: string,
  position: SourceFileLocation['position'],
)

Source from the content-addressed store, hash-verified

160}
161
162export 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
176export function formatFileLink(
177 file: string,

Callers 2

formatFileLinkFunction · 0.85

Calls 1

getGitLabBaseUrlFunction · 0.85

Tested by

no test coverage detected