From 59e3477043cb55e6b4ee9235a3293f9d16fbbb45 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Mon, 16 May 2022 12:05:38 -0700 Subject: [PATCH] fix misc linting --- jrnl/messages.py | 8 ++++---- jrnl/output.py | 7 +++---- jrnl/prompt.py | 1 - 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/jrnl/messages.py b/jrnl/messages.py index 92dded07..7803a337 100644 --- a/jrnl/messages.py +++ b/jrnl/messages.py @@ -17,13 +17,13 @@ class _MsgColor(NamedTuple): class MsgDecoration(Enum): NONE = { - "callback": lambda x, **kwargs: x, - "args": {} + "callback": lambda x, **_: x, + "args": {}, } BRACKET = { # @todo this should be a more robust function - "callback": lambda x, **kwargs: f"[ {x} ]", - "args": {} + "callback": lambda x, **_: f"[ {x} ]", + "args": {}, } BOX = { "callback": Panel, diff --git a/jrnl/output.py b/jrnl/output.py index 462a4910..b62202e1 100644 --- a/jrnl/output.py +++ b/jrnl/output.py @@ -2,10 +2,8 @@ # License: https://www.gnu.org/licenses/gpl-3.0.html import logging -import sys import textwrap -from rich import print from rich.text import Text from rich.console import Console @@ -45,7 +43,9 @@ def print_msg(msg: Message) -> None: def print_msgs( - msgs: list[Message], delimiter: str = "\n", style: MsgStyle = MsgStyle.NORMAL + msgs: list[Message], + delimiter: str = "\n", + style: MsgStyle = MsgStyle.NORMAL, ) -> None: # Same as print_msg, but for a list text = Text("") @@ -93,4 +93,3 @@ def is_keyboard_int(msg: Message) -> bool: def format_msg(msg: Message) -> Text: text = textwrap.dedent(msg.text.value.format(**msg.params)).strip() return Text(text) - diff --git a/jrnl/prompt.py b/jrnl/prompt.py index caf5d56a..3eae169c 100644 --- a/jrnl/prompt.py +++ b/jrnl/prompt.py @@ -2,7 +2,6 @@ # License: https://www.gnu.org/licenses/gpl-3.0.html import getpass -import sys from jrnl.messages import Message from jrnl.messages import MsgText