Repository navigation
Code style: docstrings on their own lines, and checks that keep the rules - #90
Merged
Merged
Conversation
…ules Every docstring in src/, tests/ and .claude/skills/ now has its quotes on their own lines, rewritten by a script that kept each docstring's cleaned text and everything outside the docstrings the same (checked by comparing the syntax trees and every comment with main; the report snapshots match too). Scripts that pass __doc__ to argparse strip it, so --help reads as before. CLAUDE.md gets a "Code style" section with the rules, and two checks hold new code to them: - tests/test_style.py fails on a docstring with text beside its quotes, and on a file with more # comments than its number in COMMENTS_LEFT (or fewer, until the number is lowered), so comments only go down. - ruff.toml adds B006, BLE001, ERA001, C901, PLR0912, PLR0913 and PLR0915; files written before the rules keep what they already broke in per-file-ignores, to be taken off as each module is cleaned up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 17, 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.
What this changes
The first two steps of bringing the code in line with the new Code style rules in CLAUDE.md:
Every docstring is reshaped so its quotes sit on their own lines. That's 2,175 docstrings across
src/,tests/and.claude/skills/:Checks so new code follows the rules:
tests/test_style.pyfails on a docstring with text beside its quotes. It also fails on a file with more#comments than its allowance inCOMMENTS_LEFT, and on one with fewer, until that number is lowered. So comments can only go down.ruff.tomladdsB006(mutable defaults),BLE001(broad except),ERA001(commented-out code) and the complexity rules (C901,PLR0912,PLR0913,PLR0915). Files written before these rules keep what they already broke inper-file-ignores; a file comes off that list as it's cleaned up.Nothing a user sees changed
inspect.getdoc, whichhelp()uses) are identical to main.agent/toolkits/base.py.snapshot.py compareshows 319 of 321 outputs identical. The other two are the line numbers insnapshot.py's own traceback forlambda-how-it-works. That case already fails on main, on Python 3.10:NameError: name 'mod' is not definedinside anexec'd list comprehension.__doc__to argparse now strip it, so--helpreads as before.check/run.pypasses (ruff, imports, package, rules, pytest: 1,164 passed). Its one rules warning,execute_statementindynamodb.py, was already there on main.No CHANGELOG entry: nothing a user sees changes.
Next
Step 3: remove the comments and refactor long functions one module per pull request, starting with
_kit/.🤖 Generated with Claude Code