Documentation
¶
Overview ¶
Package position maps review findings onto GitLab diff positions: the base/head/start SHAs plus old/new path and line GitLab requires for an inline discussion. Findings that cannot be anchored return ErrUnresolved so callers can fall back to a general note.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnresolved = errors.New("line not present in the merge request diff")
ErrUnresolved means the finding's line is not part of any hunk in the MR diff; the comment can only be posted as a general note.
Functions ¶
func Resolve ¶
func Resolve(file string, oldLine, newLine *int, index []FileIndex, refs gitlabx.DiffRefs) (*gitlabx.Position, error)
Resolve maps a finding location (file plus old/new line as reported by the reviewer) to a GitLab position. The file is matched against the new path first, then the old path (deleted/renamed files); paths on the returned position always come from the diff entry, never the finding.
Types ¶
Click to show internal directories.
Click to hide internal directories.