Skip to content

Commit

Permalink
feat: use file link in markdown report
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsimonemms committed Apr 4, 2024
1 parent f2748b7 commit 30f33f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/output/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (o MarkdownOutput) generate(report []scanner.Report) ([]byte, error) {

for _, item := range report {
res = append(res, []string{
item.File,
fmt.Sprintf("[%s](%s#L%d)", item.File, item.File, item.LineNumber),
strconv.Itoa(item.LineNumber),
item.Author,
item.Msg,
Expand Down
1 change: 0 additions & 1 deletion pkg/scanner/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ func (s *Scan) scanFileForTodo(filename string) ([]Report, error) {
// Remove prefixed slash (may or may not be in working directory)
cleanFilename = strings.TrimPrefix(cleanFilename, "/")

// @todo(sje): add the URL to the file/line number
res = append(res, Report{
File: cleanFilename,
LineNumber: lineNumber,
Expand Down
5 changes: 2 additions & 3 deletions toodaloo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
| File | Line Number | Author | Message |
| --- | --- | --- | --- |
| pkg/output/markdown.go | 30 | sje | implement report |
| pkg/scanner/scan.go | 189 | sje | get the author from the Git history |
| pkg/scanner/scan.go | 198 | sje | add the URL to the file/line number |
| [pkg/output/markdown.go](pkg/output/markdown.go#L30) | 30 | sje | implement report |
| [pkg/scanner/scan.go](pkg/scanner/scan.go#L189) | 189 | sje | get the author from the Git history |

0 comments on commit 30f33f5

Please sign in to comment.