Skip to content

Commit b281a78

Browse files
chore: shorten docstrings and single-line comments to 79 (ruff w505: doc-line-too-long) (#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 <[email protected]>
1 parent 1cc952d commit b281a78

File tree

438 files changed

+9347
-6637
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

438 files changed

+9347
-6637
lines changed

.github/scripts/generate_eip_report.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
"""Generate a markdown report of outdated EIP references from the EIP version checker output."""
1+
"""
2+
Generate a markdown report of outdated EIP references from the EIP version
3+
checker output.
4+
"""
25

36
import os
47
import re

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"editor.defaultFormatter": "esbenp.prettier-vscode"
1515
},
1616
"[python]": {
17-
"editor.rulers": [100],
17+
"editor.rulers": [79, 100],
1818
"editor.formatOnSave": true,
1919
"editor.defaultFormatter": "charliermarsh.ruff",
2020
"editor.codeActionsOnSave": {

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ line-length = 99
129129
[tool.ruff.lint]
130130
select = ["E", "F", "B", "W", "I", "A", "N", "D", "C", "ARG001"]
131131
fixable = ["I", "B", "E", "F", "W", "D", "C"]
132-
ignore = ["D205", "D203", "D212", "D415", "C420", "C901"]
132+
ignore = ["D200", "D205", "D203", "D212", "D415", "C420", "C901"]
133133

134134
[tool.ruff.lint.per-file-ignores]
135135
"tests/*" = ["ARG001"] # TODO: ethereum/execution-spec-tests#2188

src/cli/check_fixtures.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ def check_json(json_file_path: Path):
2727
"""
2828
Check all fixtures in the specified json file:
2929
1. Load the json file into a pydantic model. This checks there are no
30-
Validation errors when loading fixtures into EEST models.
30+
Validation errors when loading fixtures into EEST models.
3131
2. Serialize the loaded pydantic model to "json" (actually python data
32-
structures, ready to written as json).
32+
structures, ready to written as json).
3333
3. Load the serialized data back into a pydantic model (to get an updated
34-
hash) from step 2.
34+
hash) from step 2.
3535
4. Compare hashes:
3636
a. Compare the newly calculated hashes from step 2. and 3. and
37-
b. If present, compare info["hash"] with the calculated hash from step 2.
37+
b. If present, compare info["hash"] with the calculated hash from
38+
step 2.
3839
"""
3940
fixtures: Fixtures = Fixtures.model_validate_json(json_file_path.read_text())
4041
fixtures_json = to_json(fixtures)
@@ -86,7 +87,9 @@ def check_json(json_file_path: Path):
8687
help="Stop and raise any exceptions encountered while checking fixtures.",
8788
)
8889
def check_fixtures(input_str: str, quiet_mode: bool, stop_on_error: bool):
89-
"""Perform some checks on the fixtures contained in the specified directory."""
90+
"""
91+
Perform some checks on the fixtures contained in the specified directory.
92+
"""
9093
input_path = Path(input_str)
9194
success = True
9295
file_count = 0

src/cli/compare_fixtures.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
22
Compare two fixture folders and remove duplicates based on fixture hashes.
33
4-
This tool reads the .meta/index.json files from two fixture directories and identifies
5-
fixtures with identical hashes on a test case basis, then removes the duplicates from
6-
both of the folders. Used within the coverage workflow.
4+
This tool reads the .meta/index.json files from two fixture directories and
5+
identifies fixtures with identical hashes on a test case basis, then removes
6+
the duplicates from both of the folders. Used within the coverage workflow.
77
"""
88

99
import json
@@ -95,8 +95,8 @@ def batch_remove_fixtures_from_files(removals_by_file):
9595

9696
def rewrite_index(folder: Path, index: IndexFile, dry_run: bool):
9797
"""
98-
Rewrite the index to the correct index file, or if the test count was reduced to zero,
99-
the entire directory is deleted.
98+
Rewrite the index to the correct index file, or if the test count was
99+
reduced to zero, the entire directory is deleted.
100100
"""
101101
if len(index.test_cases) > 0:
102102
# Just rewrite the index
@@ -130,7 +130,9 @@ def main(
130130
dry_run: bool,
131131
abort_on_empty_patch: bool,
132132
):
133-
"""Compare two fixture folders and remove duplicates based on fixture hashes."""
133+
"""
134+
Compare two fixture folders and remove duplicates based on fixture hashes.
135+
"""
134136
try:
135137
# Load indices
136138
base_index = load_index(base)

src/cli/eest/commands/clean.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,23 @@
1919
def clean(all_files: bool, dry_run: bool, verbose: bool):
2020
"""
2121
Remove all generated files and directories from the repository.
22-
If `--all` is specified, the virtual environment and .tox directory will also be removed.
22+
23+
If `--all` is specified, the virtual environment and .tox directory will
24+
also be removed.
2325
2426
Args:
25-
all_files (bool): Remove the virtual environment and .tox directory as well.
27+
all_files (bool): Remove the virtual environment and .tox directory
28+
as well.
2629
2730
dry_run (bool): Simulate the cleanup without removing files.
2831
2932
verbose (bool): Show verbose output.
3033
31-
Note: The virtual environment and .tox directory are not removed by default.
34+
Note: The virtual environment and .tox directory are not removed by
35+
default.
3236
33-
Example: Cleaning all generated files and directories and show the deleted items.
37+
Example: Cleaning all generated files and directories and show the deleted
38+
items.
3439
3540
uv run eest clean --all -v
3641

src/cli/eest/make/cli.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
"""
2-
The `make` CLI streamlines the process of scaffolding tasks, such as generating new test files,
3-
enabling developers to concentrate on the core aspects of specification testing.
2+
The `make` CLI streamlines the process of scaffolding tasks, such as generating
3+
new test files, enabling developers to concentrate on the core aspects of
4+
specification testing.
45
56
6-
The module calls the appropriate function for the subcommand. If an invalid subcommand
7-
is chosen, it throws an error and shows a list of valid subcommands. If no subcommand
8-
is present, it shows a list of valid subcommands to choose from.
7+
8+
The module calls the appropriate function for the subcommand. If an invalid
9+
subcommand is chosen, it throws an error and shows a list of valid subcommands.
10+
If no subcommand is present, it shows a list of valid subcommands to choose
11+
from.
912
"""
1013

1114
import click

src/cli/eest/make/commands/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
2-
Holds subcommands for the make command. New subcommands must be created as
3-
modules and exported from this package, then registered under the make command in
4-
`cli.py`.
2+
Holds subcommands for the make command.
3+
4+
New subcommands must be created as modules and exported from this package,
5+
then registered under the make command in `cli.py`.
56
"""
67

78
from .env import create_default_env

src/cli/eest/make/commands/test.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
"""
22
Provides a CLI command to scaffold a test file.
33
4-
The `test` command guides the user through a series of prompts to generate a test file
5-
based on the selected test type, fork, EIP number, and EIP name. The generated test file
6-
is saved in the appropriate directory with a rendered template using Jinja2.
4+
The `test` command guides the user through a series of prompts to generate a
5+
test file based on the selected test type, fork, EIP number, and EIP name. The
6+
generated test file is saved in the appropriate directory with a rendered
7+
template using Jinja2.
78
"""
89

910
import os
@@ -38,10 +39,11 @@ def test():
3839
"""
3940
Generate a new test file for an EIP.
4041
41-
This function guides the user through a series of prompts to generate a test file
42-
for Ethereum execution specifications. The user is prompted to select the type of test,
43-
the fork to use, and to provide the EIP number and name. Based on the inputs, a test file
44-
is created in the appropriate directory with a rendered template.
42+
This function guides the user through a series of prompts to generate a
43+
test file for Ethereum execution specifications. The user is prompted to
44+
select the type of test, the fork to use, and to provide the EIP number and
45+
name. Based on the inputs, a test file is created in the appropriate
46+
directory with a rendered template.
4547
4648
Example:
4749
uv run eest make test

src/cli/eest/quotes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,7 @@ def box_quote(quote):
5151

5252

5353
def get_quote():
54-
"""Return random inspirational quote related to system design formatted in a box."""
54+
"""
55+
Return random inspirational quote formatted in a box.
56+
"""
5557
return box_quote(random.choice(make_something_great))

0 commit comments

Comments
 (0)