Repository navigation
Lint: align advisory flake8 with black (99), clear the E501/F84x backlog — closes #318 - #319
Merged
Merged
Conversation
The advisory flake8 pass used --max-line-length=88 while the project's black enforces 99, so every black-formatted line of length 89-99 was a permanent finding: 1,184 advisory findings on main, none actionable. - add .flake8 (line-length 99, E203/W503 black-compat, F401/F403/F405 for the star-import re-export pattern, E402 per-file for runtime.py) - drop the inert [tool.flake8] section from pyproject.toml (flake8 does not read pyproject.toml; if it did, that section ignored E501 itself) - advisory CI run now reads .flake8 instead of repeating CLI flags Co-Authored-By: Claude Code <[email protected]>
Fixes every non-complexity finding the advisory run reported at line-length 99 (94 E501, 11 F841, 6 F811, 6 F541): - wrap long docstrings/comments and over-long string literals (string content unchanged, implicit concatenation only) - drop dead local bindings and shadowed duplicate test definitions (test_runner.py kept the newer duplicate of each shadowed test) - drop f-prefixes from f-strings without placeholders The remaining 56 C901 complexity hotspots are left visible on purpose: they are a refactoring backlog, not a formatting fix. Co-Authored-By: Claude Code <[email protected]>
chigwell
approved these changes
Oct 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #318.
What this does
1. Aligns the advisory flake8 pass with the project's own black config (line-length 99).
The advisory run used
--max-line-length=88whileblack --check .(blocking) enforces 99 — so every black-formatted line of length 89–99 was a permanent finding. Advisory findings onmain: 1,184. After alignment alone: 195.Config is now codified in a checked-in
.flake8(flake8 does not readpyproject.toml, so the[tool.flake8]section there was dead — and had it been read, it would have ignored E501 entirely):max-line-length = 99(matches[tool.black])extend-ignore = E203, W503— black-style conflictsextend-ignore = F401, F403, F405— the deliberate star-import re-export pattern (main.py/runner.pyre-export runtime/tools; every tool module resolves names through it) — hundreds of hits, zero signalper-file-ignores: telegram_mcp/runtime.py: E402— imports there follow env/lock setup on purposeThe advisory CI step now just runs
flake8 . --count --exit-zero --statisticsand reads.flake8.2. Clears the remaining non-complexity backlog (94 E501, 11 F841, 6 F811, 6 F541):
result = await ...where the result was never read)tests/test_runner.pyremoved (the newer duplicate of each shadowed test is the one that actually ran — the dead earlier definitions are deleted)f-prefix dropped from f-strings without placeholdersResult
flake8 ., exit-zero)black --check .flake8 --select=E9,F63,F7,F82The 56 remaining C901 hotspots are left visible on purpose — they are a refactoring backlog (worst:
message_to_dictat 45,validate_idat 29), not something to churn in a lint PR. From here the advisory count is small enough to keep honestly near zero.Verification
🤖 Generated with Claude Code