Skip to content

Commit

Permalink
modules update: add a panel around diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Oct 24, 2024
1 parent 3bc6453 commit 4b705b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nf_core/modules/modules_differ.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Dict, List, Union

from rich.console import Console
from rich.panel import Panel
from rich.syntax import Syntax

import nf_core.utils
Expand Down Expand Up @@ -293,7 +294,8 @@ def print_diff(
# The file has changed
log.info(f"Changes in '{Path(module, file)}':")
# Pretty print the diff using the pygments diff lexer
console.print(Syntax("".join(diff), "diff", theme="ansi_dark", padding=1))
syntax = Syntax("".join(diff), "diff", theme="ansi_dark", line_numbers=True)
console.print(Panel(syntax, title=str(file), title_align="left", padding=0))

@staticmethod
def per_file_patch(patch_fn: Union[str, Path]) -> Dict[str, List[str]]:
Expand Down

0 comments on commit 4b705b8

Please sign in to comment.