From 332a6967a65a188abf9968afca87c5f3cb880962 Mon Sep 17 00:00:00 2001 From: Ircama Date: Mon, 8 Jul 2024 09:53:38 +0200 Subject: [PATCH] Fix formatting of trailing comma with black --- parse_devices.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parse_devices.py b/parse_devices.py index 1e28fbc..75aa1c2 100644 --- a/parse_devices.py +++ b/parse_devices.py @@ -317,8 +317,9 @@ if __name__ == "__main__": ) try: import black - mode = black.Mode(line_length=args.line_length) - dict_str = black.format_str(repr(printer_config), mode=mode) + printer_config = "PRINTER_CONFIG = " + repr(printer_config) + mode = black.Mode(line_length=args.line_length, magic_trailing_comma=False) + dict_str = black.format_str(printer_config, mode=mode) except Exception: import pprint dict_str = pprint.pformat(printer_config)