Skip to content

Commit 1887069

Browse files
committed
fix docstring placement in table formatter
fix JSON formatter
1 parent fce74a7 commit 1887069

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

craft_cli/completion/completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from pathlib import Path
2727
from typing import Any, cast
2828

29-
import jinja2 # type: ignore[import-not-found]
29+
import jinja2
3030
from typing_extensions import Self, override
3131

3232
import craft_cli

craft_cli/messages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class JSONFormatter(BaseFormatter):
5959
6060
Example:
6161
-------
62-
>>> formatter = JsonFormatter()
62+
>>> formatter = JSONFormatter()
6363
>>> formatter.format([{"name":"Alice","age":30})
6464
'{"name":"Alice","age":30}'
6565
@@ -82,8 +82,8 @@ class TableFormatter(BaseFormatter):
8282
"""
8383

8484
def format(self, data: TabularData, headers: dict[str, str] | None = None) -> str:
85-
_ = headers
8685
"""Format a list of rows into a table string."""
86+
_ = headers
8787
if not data:
8888
return "[no data]"
8989
if isinstance(data, list):
@@ -816,7 +816,7 @@ def data(
816816
"""
817817
formatter = self._formatters.get(output_format)
818818
if not formatter:
819-
raise ValueError(f"Unsupported format: {format}")
819+
raise ValueError(f"Unsupported format: {output_format}")
820820

821821
formatted_data = formatter.format(data, headers)
822822
stream = None if self._mode == EmitterMode.QUIET else sys.stdout

0 commit comments

Comments
 (0)