Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #179 from JoshKarpel/use-rich-for-fixture-info
Browse files Browse the repository at this point in the history
Redo fixture information display using Rich
  • Loading branch information
darrenburns authored Mar 19, 2021
2 parents 1b8149c + 141dfe8 commit f66c192
Show file tree
Hide file tree
Showing 8 changed files with 335 additions and 328 deletions.
239 changes: 121 additions & 118 deletions poetry.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions ward/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,16 @@ def build_unified_diff(lhs_repr: str, rhs_repr: str) -> str:
)
)
current_span = ""
current_span += line_to_rewrite[
index - 2
] # Subtract 2 to account for code at start of line
# Subtract 2 to account for code at start of line
current_span += line_to_rewrite[index - 2]
prev_char = char
index += 1

# Lines starting with ? aren't guaranteed to be the same length as the lines before them
# so some characters may be left over. Add any leftover characters to the output
remaining_index = (
index - 3
) # subtract 2 for code at start, and 1 to remove the newline char

# subtract 2 for code at start, and 1 to remove the newline char
remaining_index = index - 3
if prev_marker == "+":
output_lines[last_output_idx] += colored(
line_to_rewrite[remaining_index:], color="red"
Expand Down
1 change: 1 addition & 0 deletions ward/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def fixtures(
show_dependency_trees=show_dependency_trees or full,
)


@run.command()
@click.pass_context
def completions(ctx: click.Context):
Expand Down
Loading

0 comments on commit f66c192

Please sign in to comment.