Skip to content

Commit 5a88baa

Browse files
committed
fix: πŸ› Fix markdown findings
1 parent a9248cc commit 5a88baa

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

β€Žcodelimit/common/report/format_markdown.pyβ€Ž

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,18 +114,18 @@ def _print_findings_without_repository(report_units: list[ReportUnit], console:
114114
)
115115

116116

117+
def _format_link(owner: str, name: str, branch: str, unit: ReportUnit) -> str:
118+
return (f'https://github.com/{owner}/{name}/blob/{branch}/{unit.file}#L{unit.measurement.start.line}-L'
119+
f'{unit.measurement.end.line}')
120+
121+
117122
def _print_findings_with_repository(report_units: list[ReportUnit],
118123
repository: GithubRepository, console: Console):
119124
console.print("| **Function** | **Length** | **File** |")
120125
console.print("| --- | ---: | --- |")
121126
for unit in report_units:
122127
violation_type = "\u274C" if unit.measurement.value > 60 else "\u26A0"
123-
owner = repository.owner
124-
name = repository.name
125-
branch = repository.branch
126-
link = (f'https://github.com/{owner}/{name}/blob/{branch}/{unit.file}#L{unit.measurement.start.line}-L'
127-
f'{unit.measurement.end.line}')
128-
console.print(
129-
f"| {violation_type} " + '[' + unit.measurement.unit_name + ']' + f"({link}) | {unit.measurement.value} "
130-
f"| {unit.file} |"
128+
link = _format_link(repository.owner, repository.name, repository.branch, unit)
129+
print(
130+
f'| {violation_type} [{unit.measurement.unit_name}]({link}) | {unit.measurement.value} | {unit.file} |'
131131
)

0 commit comments

Comments
Β (0)