Skip to content

Commit

Permalink
Replace render_group usage
Browse files Browse the repository at this point in the history
This has been dropped in rich 11.0.0.
  • Loading branch information
rabi committed Jan 10, 2022
1 parent 12a175d commit e41e9b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ansiblelint/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
from typing import Iterable

from rich import box
from rich.console import render_group

# Remove this compatibility try-catch block once we drop support for rich < 10.7.0
try:
from rich.console import group
except ImportError:
from rich.console import render_group as group

from rich.markdown import Markdown
from rich.table import Table

Expand Down Expand Up @@ -47,7 +53,7 @@ def rules_as_rst(rules: RulesCollection) -> str:
return r


@render_group()
@group()
def rules_as_rich(rules: RulesCollection) -> Iterable[Table]:
"""Print documentation for a list of rules, returns empty string."""
width = max(16, *[len(rule.id) for rule in rules])
Expand Down

0 comments on commit e41e9b5

Please sign in to comment.