pyproject.toml: Set isort include_trailing_comma, reformat lib.App #108

Merged
Jan Lindemann merged 2 commits from jan/fix/20260914-isort-trailing-commas into master 2026-09-14 21:46:03 +02:00 AGit

The isort and yapf formatters disagree on wrapped imports: isort stripped the trailing commas that yapf's split_arguments_when_comma_terminated relies on, so the tools oscillate on files such as lib.App. This PR sets include_trailing_comma so the trailing comma becomes the point where both tools converge, then applies the resulting layout.

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.

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.

The isort and yapf formatters disagree on wrapped imports: isort stripped the trailing commas that yapf's split_arguments_when_comma_terminated relies on, so the tools oscillate on files such as lib.App. This PR sets include_trailing_comma so the trailing comma becomes the point where both tools converge, then applies the resulting layout. #### 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. #### 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.
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 <jan@janware.com>
lib.App: Reformat imports with trailing commas
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 4m34s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m22s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 4m4s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m20s
CI / Packaging test (push) Successful in 0s
1e54455c6a
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 <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-09-14 21:37:03 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!108
No description provided.