Skip to content

Fix shared settings choice-condition Python lint failure - #1235

Closed
thehobbit85 wants to merge 1 commit into
seedds:mainfrom
thehobbit85:codex/settings-choice-lint
Closed

thehobbit85 wants to merge 1 commit into
seedds:mainfrom
thehobbit85:codex/settings-choice-lint

Conversation

@thehobbit85

Copy link
Copy Markdown
Contributor

Main's Python lint run fails with Ruff B023 at dm/games/settings.py:115: the offered() helper introduced by 4e0333a5 captures the loop's row number n. The same finding fails unrelated PRs based on main, including #684's run and main's run.

Bind the current row number as a default argument when defining the helper. This preserves the current immediate-call behavior, conditional choices, and diagnostic row numbers. No lint suppression or baseline change is included.

Validation on main 975bb4c14456d145eb3d969814534eecdd996ce9, macOS with Python 3.14.6 and the pinned Ruff 0.17.2/Pyright 1.1.414 environment:

  • Before: python -m ruff check --no-cache --select B023 dm/games/settings.py fails with the exact shared B023 finding.
  • After: python dm/tools/lint_python.py --against 975bb4c14456d145eb3d969814534eecdd996ce9 passes: 389 findings, 389 in the baseline, zero new and zero fixed-but-still-listed findings.
  • python -m unittest dm.tools.tests.test_settings dm.tools.tests.test_launcher_settings: all 19 tests pass, including the Mac-only 120 fps choice, platform defaults, profile conditions and launcher metadata.
  • git diff --check passes. The diff is one line in the settings generator; no agent artifacts or operational notes are in the repository.

No gameplay or device validation was performed. This is a callback-binding lint correction with no intended launcher behavior change; existing synthetic settings tests cover the affected path. The separate C/Objective-C findings are covered by existing #1207 and are outside this PR. Hosted checks are pending.

Front-ends: none

@thehobbit85

Copy link
Copy Markdown
Contributor Author

Superseded by main f8a5618 (f8a5618). Main now defines offered(v, n) outside the row loop and passes the row number explicitly, eliminating the same B023 capture without a suppression or baseline increase. This PR contains only the one-line default-argument alternative; no distinct change remains. Fresh Ruff B023 on that exact main file passes. The settings file is byte-identical in the rebased diagnostics candidate used for 31 passing documentation/environment/settings/launcher tests, including the affected choice path. Closing as superseded, not merged; the branch is retained.

@thehobbit85 thehobbit85 closed this Nov 5, 2026
@thehobbit85
thehobbit85 deleted the codex/settings-choice-lint branch November 5, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants