Skip to content

Commit 7e00240

Browse files
spencer-tbdanceratopzmarioevz
authored
feat(all): add ruff as default linter and additional clean up (#922)
* feat: use ruff for linting. * chore: overhaul `.vscode` files. * chore(ruff): changes to `src/cli`. * chore(noqa|todo): changes to `src/cli`. * chore(tf): remove `tf` from the repo. * chore(ruff|noqa): changes to `src/config`. * chore(ruff): changes to `src/ethereum_clis`. * chore(noqa): changes to `src/ethereum_clis`. * chore(ruff): changes to `src/ethereum_test_base_types`. * chore: remove `.flake8` config. * chore(ruff): changes to `src/cli` after rebase. * chore(ruff): changes to `src/ethereum_clis` after rebase. * chore(ruff): changes to `src/ethereum_test_base_types` after rebase. * chore(ruff): changes to `src/ethereum_test_exceptions`. * chore(ruff): changes to `src/ethereum_execution`. * chore(ruff): changes to `src/ethereum_test_fixtures`. * chore(ruff): changes to `src/ethereum_test_forks`. * chore(ruff): changes to `src/ethereum_test_rpc`. * chore(ruff): changes to `src/ethereum_test_specs`. * chore(ruff): changes to `src/ethereum_test_tools`. * chore(ruff): changes to `src/ethereum_test_types`. * chore(ruff): changes to `src/ethereum_test_vm`. * chore(ruff): changes to `src/conftest.py`. * chore(ruff): changes to `src/pytest_plugins`. * chore(ruff): changes to `tests/shanghai`. * chore(ruff): changes to `tests/prague`. * chore(ruff): changes to `tests/paris`. * chore(ruff): changes to `tests/osaka`. * chore(ruff): changes to `tests/istanbul`. * chore(ruff): changes to `tests/homestead`. * chore(ruff): changes to `tests/frontier`. * chore(ruff): changes to `tests/constantinople`. * chore(ruff): changes to `tests/cancun`. * chore(ruff): changes to `tests/byzantium/`. * chore(ruff): changes to `tests/berlin`. * chore(ruff): changes to `src` to fix filling. * chore: mypy fixes part 1. * chore: mypy fixes part 2. * chore(docs): update changelog. * chore(docs): update ruff in docs. * tests: fix eip2537 ruff changes. * chore: revert uv.lock to 88c1401 for a gentler package upgrade * chore: only add ruff & remove isort etc to/from deps in uv.lock * chore: pin ruff to version 0.8.2 * style(lint): fix docstrings in github script * style(lint): fix python builtin shadowing (in ruff 0.8.2) This was required after upgrading ruff from 0.7.1 to 0.8.2 * style(lint): fix import block (in ruff 0.8.2) This was required after upgrading ruff from 0.7.1 to 0.8.2 * fix(tox.ini): Add ruff format checks * fix(fw): Formatting * fix(tests): Formatting --------- Co-authored-by: danceratopz <[email protected]> Co-authored-by: Mario Vega <[email protected]>
1 parent 1bdec80 commit 7e00240

File tree

413 files changed

+4088
-7026
lines changed

Some content is hidden

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

413 files changed

+4088
-7026
lines changed

.flake8

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/scripts/get_release_props.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# "click",
66
# ]
77
# ///
8-
8+
"""Extract the properties of a configured EEST release from a YAML file."""
99
import sys
1010

1111
import click
@@ -17,7 +17,7 @@
1717
@click.command()
1818
@click.argument('release', required=True)
1919
def get_release_props(release):
20-
"""Extracts a specific property from the YAML file for a given release."""
20+
"""Extract the properties from the YAML file for a given release."""
2121
with open(RELEASE_PROPS_FILE) as f:
2222
data = yaml.safe_load(f)
2323
if release not in data:

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ pip-delete-this-directory.txt
4949
.coverage
5050

5151
# misc
52-
.vscode/settings.json
53-
.vscode/launch.json
5452
*.code-workspace
5553
verify_kzg_proof
54+
.vscode/launch.recommended.json
55+
.vscode/settings.local.recommended.json
5656

5757
# docs
5858
.cache

.vscode/extensions.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3-
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4-
// List of extensions which should be recommended for users of this workspace.
5-
"recommendations": [
6-
"ms-python.python",
7-
"ms-python.isort",
8-
"ms-python.flake8",
9-
"ms-python.mypy-type-checker",
10-
"ms-python.black-formatter",
11-
"esbenp.prettier-vscode",
12-
"njpwerner.autodocstring", // https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring
13-
"streetsidesoftware.code-spell-checker",
14-
"tamasfe.even-better-toml",
15-
"bierner.markdown-mermaid", // https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
16-
"bpruitt-goddard.mermaid-markdown-syntax-highlighting", // https://marketplace.visualstudio.com/items?itemName=bpruitt-goddard.mermaid-markdown-syntax-highlighting
17-
"DavidAnson.vscode-markdownlint", // https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
18-
],
19-
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
20-
"unwantedRecommendations": []
2+
// List of extensions that MUST be used for users of the repo.
3+
"recommendations": [
4+
"ms-python.python",
5+
"ms-python.mypy-type-checker",
6+
"charliermarsh.ruff",
7+
"esbenp.prettier-vscode",
8+
"njpwerner.autodocstring",
9+
"streetsidesoftware.code-spell-checker",
10+
"tamasfe.even-better-toml",
11+
"bierner.markdown-mermaid",
12+
"bpruitt-goddard.mermaid-markdown-syntax-highlighting",
13+
"DavidAnson.vscode-markdownlint"
14+
],
15+
// List of extensions that MUST NOT be used for users of the repo.
16+
"unwantedRecommendations": [
17+
"ms-python.black-formatter",
18+
"ms-python.flake8",
19+
"ms-python.isort"
20+
]
2121
}

.vscode/launch.recommended.json

Lines changed: 122 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,133 @@
11
{
2-
// Use IntelliSense to learn about possible attributes.
3-
// Hover to view descriptions of existing attributes.
4-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5-
// If the VS Code "Run and Debug" button, respecively launch selector are not visible, see this answer:
6-
// https://stackoverflow.com/a/74245823
7-
//
8-
"version": "0.2.0",
9-
"configurations": [
10-
{
11-
"name": "Launch fill --until choose fork",
12-
"type": "python",
13-
"request": "launch",
14-
"module": "pytest",
15-
"args": [
16-
"-c",
17-
"pytest.ini",
18-
"--until",
19-
"${input:fork}",
20-
"--evm-bin",
21-
"${input:evmBinary}",
22-
"-v"
23-
],
24-
"cwd": "${workspaceFolder}"
25-
},
26-
{
27-
"name": "Launch fill -k choose test path",
28-
"type": "python",
29-
"request": "launch",
30-
"module": "pytest",
31-
"args": [
32-
"-c",
33-
"pytest.ini",
34-
"--until",
35-
"Cancun",
36-
"--evm-bin",
37-
"${input:evmBinary}",
38-
"-v",
39-
"-k",
40-
"${input:testPathOrId}"
41-
],
42-
"cwd": "${workspaceFolder}"
43-
},
44-
{
45-
"name": "Launch fill --until Cancun",
46-
"type": "python",
47-
"request": "launch",
48-
"module": "pytest",
49-
"args": [
50-
"-c",
51-
"pytest.ini",
52-
"--until",
53-
"Cancun",
54-
"--evm-bin",
55-
"${input:evmBinary}",
56-
"-v"
57-
],
58-
"cwd": "${workspaceFolder}"
59-
},
60-
{
61-
"name": "Launch fill --until Prague",
62-
"type": "python",
63-
"request": "launch",
64-
"module": "pytest",
65-
"args": [
66-
"-c",
67-
"pytest.ini",
68-
"--until",
69-
"Prague",
70-
"--evm-bin",
71-
"${input:evmBinary}",
72-
"-v"
73-
],
74-
"cwd": "${workspaceFolder}"
75-
}
76-
],
77-
"inputs": [
78-
{
79-
"type": "pickString",
80-
"id": "evmBinary",
81-
"description": "Which evm binary to you want to run?",
82-
"options": [
2+
"_comment": [
3+
"Main configuration for VS Code debugging",
4+
"Use IntelliSense to learn about possible attributes.",
5+
"If the VS Code 'Run and Debug' button or launch selector",
6+
"is not visible, see: https://stackoverflow.com/a/74245823"
7+
],
8+
"version": "0.2.0",
9+
"configurations": [
8310
{
84-
"label": "First evm binary in PATH",
85-
"value": "evm",
11+
"name": "Launch fill --until choose fork",
12+
"type": "debugpy",
13+
"request": "launch",
14+
"module": "pytest",
15+
"args": [
16+
"-c",
17+
"pytest.ini",
18+
"--until",
19+
"${input:fork}",
20+
"--evm-bin",
21+
"${input:evmBinary}",
22+
"-v"
23+
],
24+
"cwd": "${workspaceFolder}"
8625
},
8726
{
88-
"label": "Geth, mario's repo",
89-
"value": "~/code/github/marioevz/go-ethereum/build/bin/evm",
27+
"name": "Launch fill -k choose test path",
28+
"type": "debugpy",
29+
"request": "launch",
30+
"module": "pytest",
31+
"args": [
32+
"-c",
33+
"pytest.ini",
34+
"--until",
35+
"Cancun",
36+
"--evm-bin",
37+
"${input:evmBinary}",
38+
"-v",
39+
"-k",
40+
"${input:testPathOrId}"
41+
],
42+
"cwd": "${workspaceFolder}"
9043
},
9144
{
92-
"label": "Geth, danceratopz's repo",
93-
"value": "~/code/github/danceratopz/go-ethereum/build/bin/evm",
45+
"name": "Launch fill --until Cancun",
46+
"type": "debugpy",
47+
"request": "launch",
48+
"module": "pytest",
49+
"args": [
50+
"-c",
51+
"pytest.ini",
52+
"--until",
53+
"Cancun",
54+
"--evm-bin",
55+
"${input:evmBinary}",
56+
"-v"
57+
],
58+
"cwd": "${workspaceFolder}"
9459
},
9560
{
96-
"label": "evmone",
97-
"value": "~/code/github/ethereum/evmone/build/bin/evmone-t8n",
61+
"name": "Launch fill --until Prague",
62+
"type": "debugpy",
63+
"request": "launch",
64+
"module": "pytest",
65+
"args": [
66+
"-c",
67+
"pytest.ini",
68+
"--until",
69+
"Prague",
70+
"--evm-bin",
71+
"${input:evmBinary}",
72+
"-v"
73+
],
74+
"cwd": "${workspaceFolder}"
75+
}
76+
],
77+
"inputs": [
78+
{
79+
"type": "pickString",
80+
"id": "evmBinary",
81+
"description": "Which evm binary to you want to run?",
82+
"options": [
83+
{
84+
"label": "First evm binary in PATH",
85+
"value": "evm"
86+
},
87+
{
88+
"label": "Geth, mario's repo",
89+
"value": "~/code/github/marioevz/go-ethereum/build/bin/evm"
90+
},
91+
{
92+
"label": "Geth, danceratopz's repo",
93+
"value": "~/code/github/danceratopz/go-ethereum/build/bin/evm"
94+
},
95+
{
96+
"label": "evmone",
97+
"value": "~/code/github/ethereum/evmone/build/bin/evmone-t8n"
98+
},
99+
{
100+
"label": "besu",
101+
"value": "~/code/github/danceratopz/besu/ethereum/evmtool/build/install/evmtool/bin/evm"
102+
}
103+
],
104+
"default": "evm"
105+
},
106+
{
107+
"type": "pickString",
108+
"id": "fork",
109+
"description": "Which fork do you want to use?",
110+
"options": [
111+
"Frontier",
112+
"Homestead",
113+
"Byzantium",
114+
"Constantinople",
115+
"ConstantinopleFix",
116+
"Istanbul",
117+
"Berlin",
118+
"London",
119+
"Paris",
120+
"Shanghai",
121+
"Cancun",
122+
"Prague"
123+
],
124+
"default": "Cancun"
98125
},
99126
{
100-
"label": "besu",
101-
"value": "~/code/github/danceratopz/besu/ethereum/evmtool/build/install/evmtool/bin/evm",
127+
"type": "promptString",
128+
"id": "testPathOrId",
129+
"description": "Enter a test path string or id to provide to pytest -k",
130+
"default": "test_"
102131
}
103-
],
104-
"default": "evm"
105-
},
106-
{
107-
"type": "pickString",
108-
"id": "fork",
109-
"description": "Which fork do you want to use?",
110-
"options": [
111-
"Frontier",
112-
"Homestead",
113-
"Byzantium",
114-
"Constantinople",
115-
"ConstantinopleFix",
116-
"Istanbul",
117-
"Berlin",
118-
"London",
119-
"Paris",
120-
"Shanghai",
121-
"Cancun",
122-
"Prague",
123-
],
124-
"default": "Cancun"
125-
},
126-
{
127-
"type": "promptString",
128-
"id": "testPathOrId",
129-
"description": "Enter a test path string or id to provide to pytest -k",
130-
"default": "test_"
131-
}
132-
]
133-
}
132+
]
133+
}

.vscode/settings.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// Static settings that users MUST adhere to when
3+
// developing with the EEST repo.
4+
"cSpell.customDictionaries": {
5+
"project-words": {
6+
"name": "project-words",
7+
"path": "${workspaceRoot}/whitelist.txt",
8+
"description": "Words used in this project",
9+
"addWords": true
10+
},
11+
"custom": true,
12+
"internal-terms": false
13+
},
14+
"[json]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode"
16+
},
17+
"[python]": {
18+
"editor.rulers": [100],
19+
"editor.formatOnSave": true,
20+
"editor.defaultFormatter": "charliermarsh.ruff",
21+
"editor.codeActionsOnSave": {
22+
"source.organizeImports": "explicit"
23+
}
24+
},
25+
"python.analysis.autoFormatStrings": true,
26+
"ruff.enable": true,
27+
"ruff.lint.args": ["--line-length", "99", "--fix"],
28+
"extensions.ignoreRecommendations": false
29+
}

0 commit comments

Comments
 (0)