From d08715ba074525d89eb9e37b27b372b3b52eae71 Mon Sep 17 00:00:00 2001 From: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com> Date: Sun, 3 Nov 2024 16:23:58 +0200 Subject: [PATCH] Send ruff's stderr to `os.devnull` --- mdformat_ruff/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mdformat_ruff/__init__.py b/mdformat_ruff/__init__.py index b5c1ed1..33968b3 100644 --- a/mdformat_ruff/__init__.py +++ b/mdformat_ruff/__init__.py @@ -17,5 +17,7 @@ def format_python(unformatted: str, _info_str: str) -> str: :rtype: str """ return subprocess.check_output( - [find_ruff_bin(), "format", "-"], input=unformatted.encode() + [find_ruff_bin(), "format", "-"], + input=unformatted.encode(), + stderr=subprocess.DEVNULL, ).decode()