Skip to content

Conversation

felix314159
Copy link
Collaborator

@felix314159 felix314159 commented Sep 19, 2025

πŸ—’οΈ 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 .github
  • uv run ruff check --select W505 --config 'lint.pycodestyle.max-doc-length = 79' src tests .github

The command
uv run ruff format --check src tests .github
gives me 720 files already formatted.

Mypy still passes: uv run mypy

πŸ”— Related Issues or PRs

N/A.

βœ… Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

@danceratopz danceratopz changed the title chores(line_lenghts): Shorten docstrings and single-line comments (W505) chore: shorten docstrings and single-line comments to 79 (ruff w505: doc-line-too-long) Sep 22, 2025
@danceratopz
Copy link
Member

It seems to say 58 files would be reformatted, so let's try to reproduce this locally (which command?), should be a simple fix

Reproduce with:

ruff format --check src tests .github/scripts

and drop the --check to fix/format them.

Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Lint-related: Broken formatting in docstrings that contain unordered lists (i.e., they start with -).
  2. 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:

Happy to align, when you're ready to pick this up!

@felix314159 felix314159 force-pushed the comment-and-docstring-fixes branch 2 times, most recently from c601f1d to 2a7a47c Compare September 23, 2025 15:42
@danceratopz danceratopz added the scope:tooling Scope: Python tools (uv, ruff, tox,...) label Sep 24, 2025
@felix314159 felix314159 force-pushed the comment-and-docstring-fixes branch from fc960fb to 5981abd Compare September 25, 2025 12:44
@felix314159 felix314159 force-pushed the comment-and-docstring-fixes branch from e96a3cd to bff747c Compare September 25, 2025 15:33
@felix314159
Copy link
Collaborator Author

felix314159 commented Sep 25, 2025

confirmed with hasher that uv run fill --until=osaka --clean -n auto --output=fixtures-before -m "not slow" gives the same result as on main:

` diff -u hasher-before.txt hasher-after.txt `
1c1
< fixtures-before: 0x11c3343ea40d3e2e76a7ac41f18c3a85a08bc074427935f9a65a9d96d3f5dae4
---
> fixtures-after: 0x11c3343ea40d3e2e76a7ac41f18c3a85a08bc074427935f9a65a9d96d3f5dae4

Copy link
Contributor

@spencer-tb spencer-tb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

Copy link
Member

@danceratopz danceratopz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for all your work on this @felix314159 !

@felix314159 felix314159 merged commit b281a78 into ethereum:main Sep 25, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:tooling Scope: Python tools (uv, ruff, tox,...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants