chore: shorten docstrings and single-line comments to 79 (ruff w505: doc-line-too-long)#2180
Conversation
Reproduce with: and drop the |
There was a problem hiding this comment.
Oh my word @felix314159, we've embarked on quite the mission with this one 😆
I did some manual review. Three are some slight differences in formatting in the docstrings (e.g., indentation), but I think we can live with it.
There are two broken things still:
- Lint-related: Broken formatting in docstrings that contain unordered lists (i.e., they start with
-). - Docflow-related and lint-related): Some of the fixes here break formatting in the auto-generated test case reference html section. In general, the use of the "abstract" admonition in test module docstrings for the generated test case reference imposes an unnecessarily strict syntax for docstrings which is not Python native. It is annoying for developers and error prone. I think it'd be best just to remove it here.
I need to take a break from this one for a bit. Perhaps you could have a look at 1 @felix314159? Once recharged and you're ready for a rest, I can handle 2.
For 2. I would remove all "abstract" admonitions and use this format:
"""
One line summary.
Longer description, if available, if not, the docstring is a single-liner.
"""
And I think we should continue to ignore D200 post-weld, see comments here:
- ethereum/execution-specs#1428 (comment)
- ethereum/execution-specs#1428 (comment) (I would love to enable D205, but I think it's too much work in one bulk PR - the solution to 2. above is so that we could, and imo should, enable it for
./tests/).
Happy to align, when you're ready to pick this up!
c601f1d to
2a7a47c
Compare
fc960fb to
5981abd
Compare
e96a3cd to
bff747c
Compare
|
confirmed with hasher that |
danceratopz
left a comment
There was a problem hiding this comment.
Thanks a lot for all your work on this @felix314159 !
…doc-line-too-long) (ethereum#2180) * split comments across multiple lines when necessary * chore(tooling): check w505 in tox lint env * fixes * chore: remove abstract and other admonitions from test module docstrings * fixes * chore: fix more malformatted tables * chore: fix broken unordered-lists/args * chore: fix broken unordered-lists/args * chore: improve docstrings, also for D205 * chore: improve docstrings, also for D205 * chore: fix long or poorly formatted comments * chore: manually revert and fix docstrings/comments * fix: bad string formatting fix in unit test * last batch of manual fixes * fix * fix --------- Co-authored-by: danceratopz <danceratopz@gmail.com>
🗒️ Description
This required two separate scripts, a bunch of manual fixes and we should ignore rule D200: unnecessary-multiline-docstring).
Please thoroughly review if CI passes and u find the time.
Both of these commands gives me
All checks passed!:uv run ruff check src tests .githubuv run ruff check --select W505 --config 'lint.pycodestyle.max-doc-length = 79' src tests .githubThe command
uv run ruff format --check src tests .githubgives me
720 files already formatted.Mypy still passes:
uv run mypy🔗 Related Issues or PRs
N/A.
✅ Checklist
toxchecks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlinttype(scope):.mkdocs servelocally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.@ported_frommarker.