Skip to content

style: format with black to unblock CI lint gate - #17

Merged
Ginkobaloba merged 2 commits into
mainfrom
chore/black-format
Sep 25, 2026
Merged

Ginkobaloba merged 2 commits into
mainfrom
chore/black-format

Conversation

@Ginkobaloba

Copy link
Copy Markdown
Owner

Summary

The "Lint (ruff + black)" CI job has been failing at step 6 ("Black check") on every PR, unrelated to what any PR actually changes. This is why #15 (54 days open, the oldest open PR in the fleet) and #16 (23 days) are blocked, even though both are clean workflow-version bumps with green tests and mypy. This PR fixes only the formatting drift so that gate goes green again.

What was done

  • Ran black across the exact paths the CI lint job checks (pm_bot run_bot.py scripts tests) and committed the result as a standalone mechanical commit.
  • Added .git-blame-ignore-revs so git blame (and GitHub's web blame) skips that reformat commit and falls back to the line's real authorship commit.

Black version and settings

.github/workflows/ci.yml line 30 installs black with pip install ruff black, i.e. no version is pinned -- CI always resolves whatever is current on PyPI at run time. I installed the same way and got black 26.5.1, which is what a CI run today would also get. Settings come from [tool.black] in pyproject.toml: line-length = 100, target-version = ["py310", "py311", "py312"], extend-exclude for .mypy_cache and kalshi_edge_finder.py. No skip-string-normalization, so black's default quote normalization applies.

I ran black on CI's exact path list (pm_bot run_bot.py scripts tests), not black . on the whole repo, so the diff matches exactly what the Black check step evaluates -- nothing outside that scope was touched.

Verification (all local, all green)

  • File count: 24 files reformatted, matching the "24 files would be reformatted" CI failure this PR is fixing.
  • No behavior change: parsed the AST of all 24 changed files before and after the reformat (ast.dump, attributes excluded) -- every file is AST-identical. This is the strongest evidence the change is purely cosmetic.
  • black --check pm_bot run_bot.py scripts tests: passes, "38 files would be left unchanged."
  • ruff check pm_bot run_bot.py scripts tests (ruff 0.16.9, also unpinned in CI, same resolution logic as black): passes, "All checks passed!" -- black did not introduce anything ruff objects to, so no ruff-driven fixes were needed.
  • Tests: pytest tests/ -q -- 16 passed. Note: run locally on Python 3.13 (only Python available on this machine), not the 3.10/3.11/3.12 matrix CI runs; I did not have a way to run the full matrix locally. The reformat is AST-identical so there's no version-specific behavior at risk, but flagging this rather than implying the full matrix ran.

Important: how this PR must be merged

.git-blame-ignore-revs references the formatting commit's SHA directly. This PR must be merged with "Create a merge commit," not squash or rebase. Squash or rebase merging rewrites/discards that SHA on main, and the blame-ignore file would point at a commit that never lands there, silently going dead on arrival. The repo currently has all three merge methods enabled.

To use it after merge (once, per clone):

git config blame.ignoreRevsFile .git-blame-ignore-revs

A note to this effect is also added next to [tool.black] in pyproject.toml.

Unblocks

#15 and #16 are both blocked solely by this pre-existing, content-unrelated formatting failure. Once this merges (as a merge commit) and main is green, rebasing/updating those two PRs should let their own checks pass on the current formatting baseline.

🤖 Generated with Claude Code

https://claude.ai/code/session_014ST4EyP7XFr92rgawwPJC1

Ginkobaloba and others added 2 commits September 25, 2026 02:37
Applies black 26.5.1 (unpinned in CI, resolved to latest at run time)
using the repo's tool.black config (line-length 100, target-version
py310/py311/py312) across the exact paths CI checks: pm_bot,
run_bot.py, scripts, tests. 24 files reformatted, mechanical only.

Verified: AST of every changed file is identical before and after
(ast.dump comparison), black --check and ruff check both pass, and the
local test suite (16 tests) still passes. No behavior change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ST4EyP7XFr92rgawwPJC1
Adds .git-blame-ignore-revs listing the black reformat commit
(c370d54) so `git blame` and GitHub's
web blame skip past it to the line's real authorship commit.

The file alone does nothing locally: it only takes effect after
running `git config blame.ignoreRevsFile .git-blame-ignore-revs` (a
one-time per-clone setting), or by passing --ignore-revs-file
explicitly. A note to that effect is added next to [tool.black] in
pyproject.toml. Verified with `git blame -L` on a line the reformat
commit touched: without the config it attributes to the reformat
commit, with it the attribution falls back to the original commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ST4EyP7XFr92rgawwPJC1
@Ginkobaloba
Ginkobaloba merged commit 8d3b73b into main Sep 25, 2026
8 checks passed
@Ginkobaloba
Ginkobaloba deleted the chore/black-format branch September 25, 2026 07:45
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.

1 participant