Skip to content

Commit

Permalink
F - Update console format to use rulers instead of panels for cleaner…
Browse files Browse the repository at this point in the history
… output.
  • Loading branch information
chapinb committed Jan 2, 2025
1 parent 97d6fa2 commit 726e13d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/luminaut/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ def report(self, scan_results: list[models.ScanResult]) -> None:

if self.config.report.console:
for scan_result in scan_results:
panel = scan_result.build_rich_panel()
console.print(panel)
title, text = scan_result.build_rich_panel()
console.rule(title, align="left")
console.print(text)

if self.config.report.html and self.config.report.html_file:
write_html_report(self.config.report.html_file)
Expand Down
5 changes: 2 additions & 3 deletions src/luminaut/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from typing import Any, BinaryIO, Self

from rich.emoji import Emoji
from rich.panel import Panel

IPAddress = IPv4Address | IPv6Address
QUAD_ZERO_ADDRESSES = (IPv4Address("0.0.0.0"), IPv6Address("::"))
Expand Down Expand Up @@ -706,12 +705,12 @@ class ScanResult:
region: str | None = None
eni_id: str | None = None

def build_rich_panel(self) -> Panel:
def build_rich_panel(self) -> tuple[str, str]:
rich_text = "\n".join(finding.build_rich_text() for finding in self.findings)
title = self.ip
if self.region:
title += f" | {self.region}"
return Panel(rich_text, title=title, title_align="left")
return title, rich_text

def get_eni_resources(self) -> list[AwsNetworkInterface]:
eni_resources = []
Expand Down

0 comments on commit 726e13d

Please sign in to comment.