Fix Linting CI with YAPF Formatting

Codex·GPT-5.6-sol·Maxwell-Rosen·1w ago·2min·1 Checkpoint·11 file changes·+236/-260·42.9K tokens

Linting CI is failing. Fix it + plain = plotly_module._write_plotly_output(figure,

  • empty = plotly_module._write_plotly_output(figure,
  • assert rotating.endswith("figure.html") assert plain.endswith("figure.html") assert empty == ".html" @@ -736,18 +731,16 @@ class TestOutputHelpers: opened = [] monkeypatch.setattr(plotly_module.tempfile, "gettempdir", lambda: str(tmp_path))
  • monkeypatch.setattr(
  • monkeypatch.setattr(plotly_module, "save_rotating_plotly_figure",
  • monkeypatch.setattr(plotly_module.webbrowser, "open", lambda uri: opened.append(uri))
  • path = plotly_module._preview_plotly_figure(
  • path = plotly_module._preview_plotly_figure(object(),
  • assert path.endswith("plotly_preview_preview.html") assert saved == [path] named_path = plotly_module._preview_plotly_figure( @@ -766,18 +759,17 @@ class TestOutputHelpers: calls = [] monkeypatch.setattr( plotly_module, "_write_plotly_output",
  • monkeypatch.setattr( plotly_module, "_preview_plotly_figure",
  • monkeypatch.setattr(plotly_module, "open_preview", lambda path: calls.append(("open", path)))

    plotly(_surface_2d(), save=True) plotly(_surface_2d(), show=True) plotly(_surface_2d(), saveas="figure.html", show=True)

  • assert [call[0] for call in calls] == [
  • ]
  • assert [call[0]

diff --git a/tests/test_version_report.py b/tests/test_version_report.py index a3bb3d8..538145e 100644 --- a/tests/test_version_report.py +++ b/tests/test_version_report.py @@ -8,7 +8,6 @@ import subprocess

import pytest

version = import_module("postgkyl._version")

pytestmark = pytest.mark.compatibility @@ -18,10 +17,10 @@ def test_git_returns_none_outside_a_checkout(tmp_path): assert version._git(tmp_path, "status") is None

-@pytest.mark.parametrize("error", [OSError("missing git"),

-def test_git_converts_process_failures_to_missing(monkeypatch, tmp_path,

+@pytest.mark.parametrize(

  • "error", [OSError("missing git"),

+def test_git_converts_process_failures_to_missing(monkeypatch, tmp_path, error): (tmp_path / ".git").mkdir()

def fail(*_args, **_kwargs): @@ -35,10 +34,12 @@ def test_git_converts_process_failures_to_missing(monkeypatch, tmp_path, ("build", "expected"), [ (None, "unknown (not a git checkout)"),

  • ], ) def test_postgkyl_commit_uses_baked_fallback(monkeypatch, build, expected): Error: Process completed with exit code 1.
1w ago·5.5s

I’ll reproduce the lint check, inspect the affected test files and repository formatting configuration, then apply the smallest formatting-only fix and verify the same CI command locally.

The failure is YAPF’s formatting hook, not Ruff: the checked-in code matches the “before” side of the CI diff you pasted. The local pre-commit cache is read-only in this environment, so I’m invoking the pinned formatter directly (and will use a temporary hook cache for the final aggregate check).

The formatter found 11 tracked Python test files in the same failing batch, including the two visible in the pasted tail. I’ve applied YAPF 0.43.0 to exactly those files; no source behavior was changed. I’m now checking formatter idempotence, Ruff, and whitespace/conflict hygiene across all tracked files.

Fixed the linting CI failure by formatting all 11 affected test files with pinned YAPF 0.43.0.

Verified:

  • YAPF clean
  • Ruff clean
  • Pre-commit config valid
  • Python compilation successful

Unrelated untracked files were untouched.