From ff581b9f9fcb61a3db82bb602d245e64d3d99072 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 14 Sep 2026 21:14:21 +0200 Subject: [PATCH 1/2] pyproject.toml: Set isort include_trailing_comma The isort configuration leaves include_trailing_comma at its default, false, so isort strips the trailing commas from wrapped imports. However, yapf's split_arguments_when_comma_terminated setting depends on those commas: without them, yapf re-joins the one-per-line import layout that isort just produced, and the two formatters disagree on files such as src/python/jw/pkg/lib/App.py. Set include_trailing_comma so that isort keeps trailing commas and yapf honors them, making both tools converge on the same layout. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1 Signed-off-by: Jan Lindemann --- conf/templates/pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/templates/pyproject.toml b/conf/templates/pyproject.toml index 6b6a5d57..50c7c7bf 100644 --- a/conf/templates/pyproject.toml +++ b/conf/templates/pyproject.toml @@ -18,6 +18,11 @@ [tool.isort] multi_line_output = 3 + + # Keep trailing commas so that yapf's split_arguments_when_comma_terminated + # keeps the one-per-line layout that isort produces. + include_trailing_comma = true + line_length = 88 lines_after_imports = 1 lines_between_sections = 1 -- 2.55.0 From 1e54455c6a6683efc2c519a6aecf2fdd12094026 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 14 Sep 2026 21:14:27 +0200 Subject: [PATCH 2/2] lib.App: Reformat imports with trailing commas Running make format with the new isort setting rewrites the two wrapped import blocks: - The argparse import is split one-per-line, since the logical line exceeds 88 columns - A trailing comma is added to both imports, which makes yapf keep the split layout instead of re-joining it The result is a fixed point that both isort and yapf accept, so make format and make check agree. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.85.1 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/App.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/python/jw/pkg/lib/App.py b/src/python/jw/pkg/lib/App.py index a0febcc7..b35d7c8e 100644 --- a/src/python/jw/pkg/lib/App.py +++ b/src/python/jw/pkg/lib/App.py @@ -7,7 +7,10 @@ import sys import warnings from argparse import ( - ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace, _SubParsersAction + ArgumentDefaultsHelpFormatter, + ArgumentParser, + Namespace, + _SubParsersAction, ) from typing import TYPE_CHECKING, Any, NamedTuple, cast, override @@ -24,7 +27,7 @@ from .log import ( parse_log_flags, parse_log_level, set_log_flags, - set_log_level + set_log_level, ) from .Types import LoadTypes from .util import pretty_cmd -- 2.55.0