Fix mypy type errors in render.py by annotating renderable variable
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from rich.console import Console
|
from rich.console import Console, RenderableType
|
||||||
from rich.json import JSON as RichJSON
|
from rich.json import JSON as RichJSON
|
||||||
from rich.markdown import Markdown
|
from rich.markdown import Markdown
|
||||||
from rich.syntax import Syntax
|
from rich.syntax import Syntax
|
||||||
@@ -36,6 +36,7 @@ def render(
|
|||||||
|
|
||||||
use_pager = sys.stdout.isatty()
|
use_pager = sys.stdout.isatty()
|
||||||
|
|
||||||
|
renderable: RenderableType
|
||||||
if file_type in _MARKDOWN_TYPES:
|
if file_type in _MARKDOWN_TYPES:
|
||||||
renderable = Markdown(content)
|
renderable = Markdown(content)
|
||||||
elif file_type in _JSON_TYPES:
|
elif file_type in _JSON_TYPES:
|
||||||
|
|||||||
Reference in New Issue
Block a user