Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): add ruff as default linter and additional clean up #922

Merged
merged 50 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
d9ec1f0
feat: use ruff for linting.
spencer-tb Sep 19, 2024
7f3b5ca
chore: overhaul `.vscode` files.
spencer-tb Oct 29, 2024
ed667a7
chore(ruff): changes to `src/cli`.
spencer-tb Oct 30, 2024
c4b7c59
chore(noqa|todo): changes to `src/cli`.
spencer-tb Oct 30, 2024
11ac638
chore(tf): remove `tf` from the repo.
spencer-tb Oct 30, 2024
098f169
chore(ruff|noqa): changes to `src/config`.
spencer-tb Oct 30, 2024
ea02cbc
chore(ruff): changes to `src/ethereum_clis`.
spencer-tb Oct 30, 2024
9c0a62a
chore(noqa): changes to `src/ethereum_clis`.
spencer-tb Oct 30, 2024
60e5748
chore(ruff): changes to `src/ethereum_test_base_types`.
spencer-tb Oct 30, 2024
21c7e49
chore: remove `.flake8` config.
spencer-tb Dec 6, 2024
67fcabd
chore(ruff): changes to `src/cli` after rebase.
spencer-tb Dec 6, 2024
2be6a9d
chore(ruff): changes to `src/ethereum_clis` after rebase.
spencer-tb Dec 6, 2024
1f2ce49
chore(ruff): changes to `src/ethereum_test_base_types` after rebase.
spencer-tb Dec 6, 2024
3ef02e0
chore(ruff): changes to `src/ethereum_test_exceptions`.
spencer-tb Dec 6, 2024
56b4cac
chore(ruff): changes to `src/ethereum_execution`.
spencer-tb Dec 6, 2024
7744fbc
chore(ruff): changes to `src/ethereum_test_fixtures`.
spencer-tb Dec 6, 2024
461e9cc
chore(ruff): changes to `src/ethereum_test_forks`.
spencer-tb Dec 6, 2024
8c6a3d7
chore(ruff): changes to `src/ethereum_test_rpc`.
spencer-tb Dec 6, 2024
c772bf4
chore(ruff): changes to `src/ethereum_test_specs`.
spencer-tb Dec 6, 2024
4ea606d
chore(ruff): changes to `src/ethereum_test_tools`.
spencer-tb Dec 6, 2024
d23b4ee
chore(ruff): changes to `src/ethereum_test_types`.
spencer-tb Dec 6, 2024
5a39eba
chore(ruff): changes to `src/ethereum_test_vm`.
spencer-tb Dec 6, 2024
19823f1
chore(ruff): changes to `src/conftest.py`.
spencer-tb Dec 6, 2024
cbc5f23
chore(ruff): changes to `src/pytest_plugins`.
spencer-tb Dec 6, 2024
ab5b98c
chore(ruff): changes to `tests/shanghai`.
spencer-tb Dec 7, 2024
023d51c
chore(ruff): changes to `tests/prague`.
spencer-tb Dec 7, 2024
9aa79d4
chore(ruff): changes to `tests/paris`.
spencer-tb Dec 7, 2024
607a2f5
chore(ruff): changes to `tests/osaka`.
spencer-tb Dec 7, 2024
2a2e680
chore(ruff): changes to `tests/istanbul`.
spencer-tb Dec 7, 2024
6dd229e
chore(ruff): changes to `tests/homestead`.
spencer-tb Dec 7, 2024
9825d2a
chore(ruff): changes to `tests/frontier`.
spencer-tb Dec 7, 2024
e3dd8c6
chore(ruff): changes to `tests/constantinople`.
spencer-tb Dec 7, 2024
05aad76
chore(ruff): changes to `tests/cancun`.
spencer-tb Dec 7, 2024
28181c6
chore(ruff): changes to `tests/byzantium/`.
spencer-tb Dec 7, 2024
9dda91f
chore(ruff): changes to `tests/berlin`.
spencer-tb Dec 7, 2024
affdebe
chore(ruff): changes to `src` to fix filling.
spencer-tb Dec 7, 2024
12378c2
chore: mypy fixes part 1.
spencer-tb Dec 7, 2024
1b78adf
chore: mypy fixes part 2.
spencer-tb Dec 7, 2024
b5dd8c7
chore(docs): update changelog.
spencer-tb Dec 7, 2024
e7143de
chore(docs): update ruff in docs.
spencer-tb Dec 7, 2024
b86f111
tests: fix eip2537 ruff changes.
spencer-tb Dec 7, 2024
5c418b5
chore: revert uv.lock to 88c1401 for a gentler package upgrade
danceratopz Dec 9, 2024
71dc35f
chore: only add ruff & remove isort etc to/from deps in uv.lock
danceratopz Dec 9, 2024
db9062c
chore: pin ruff to version 0.8.2
danceratopz Dec 9, 2024
46b98b5
style(lint): fix docstrings in github script
danceratopz Dec 9, 2024
f804a4b
style(lint): fix python builtin shadowing (in ruff 0.8.2)
danceratopz Dec 9, 2024
c39fc25
style(lint): fix import block (in ruff 0.8.2)
danceratopz Dec 9, 2024
a03c251
fix(tox.ini): Add ruff format checks
marioevz Dec 27, 2024
6de8c7b
fix(fw): Formatting
marioevz Dec 27, 2024
a8b0a68
fix(tests): Formatting
marioevz Dec 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 0 additions & 34 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/scripts/get_release_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# "click",
# ]
# ///

"""Extract the properties of a configured EEST release from a YAML file."""
import sys

import click
Expand All @@ -17,7 +17,7 @@
@click.command()
@click.argument('release', required=True)
def get_release_props(release):
"""Extracts a specific property from the YAML file for a given release."""
"""Extract the properties from the YAML file for a given release."""
with open(RELEASE_PROPS_FILE) as f:
data = yaml.safe_load(f)
if release not in data:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ pip-delete-this-directory.txt
.coverage

# misc
.vscode/settings.json
.vscode/launch.json
*.code-workspace
verify_kzg_proof
.vscode/launch.recommended.json
.vscode/settings.local.recommended.json

# docs
.cache
Expand Down
38 changes: 19 additions & 19 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"ms-python.python",
"ms-python.isort",
"ms-python.flake8",
"ms-python.mypy-type-checker",
"ms-python.black-formatter",
"esbenp.prettier-vscode",
"njpwerner.autodocstring", // https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
"bierner.markdown-mermaid", // https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
"bpruitt-goddard.mermaid-markdown-syntax-highlighting", // https://marketplace.visualstudio.com/items?itemName=bpruitt-goddard.mermaid-markdown-syntax-highlighting
"DavidAnson.vscode-markdownlint", // https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
// List of extensions that MUST be used for users of the repo.
"recommendations": [
"ms-python.python",
"ms-python.mypy-type-checker",
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"njpwerner.autodocstring",
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
"bierner.markdown-mermaid",
"bpruitt-goddard.mermaid-markdown-syntax-highlighting",
"DavidAnson.vscode-markdownlint"
],
// List of extensions that MUST NOT be used for users of the repo.
"unwantedRecommendations": [
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort"
]
}
244 changes: 122 additions & 122 deletions .vscode/launch.recommended.json
Original file line number Diff line number Diff line change
@@ -1,133 +1,133 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// If the VS Code "Run and Debug" button, respecively launch selector are not visible, see this answer:
// https://stackoverflow.com/a/74245823
//
"version": "0.2.0",
"configurations": [
{
"name": "Launch fill --until choose fork",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"${input:fork}",
"--evm-bin",
"${input:evmBinary}",
"-v"
],
"cwd": "${workspaceFolder}"
},
{
"name": "Launch fill -k choose test path",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"Cancun",
"--evm-bin",
"${input:evmBinary}",
"-v",
"-k",
"${input:testPathOrId}"
],
"cwd": "${workspaceFolder}"
},
{
"name": "Launch fill --until Cancun",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"Cancun",
"--evm-bin",
"${input:evmBinary}",
"-v"
],
"cwd": "${workspaceFolder}"
},
{
"name": "Launch fill --until Prague",
"type": "python",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"Prague",
"--evm-bin",
"${input:evmBinary}",
"-v"
],
"cwd": "${workspaceFolder}"
}
],
"inputs": [
{
"type": "pickString",
"id": "evmBinary",
"description": "Which evm binary to you want to run?",
"options": [
"_comment": [
"Main configuration for VS Code debugging",
"Use IntelliSense to learn about possible attributes.",
"If the VS Code 'Run and Debug' button or launch selector",
"is not visible, see: https://stackoverflow.com/a/74245823"
],
"version": "0.2.0",
"configurations": [
{
"label": "First evm binary in PATH",
"value": "evm",
"name": "Launch fill --until choose fork",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"${input:fork}",
"--evm-bin",
"${input:evmBinary}",
"-v"
],
"cwd": "${workspaceFolder}"
},
{
"label": "Geth, mario's repo",
"value": "~/code/github/marioevz/go-ethereum/build/bin/evm",
"name": "Launch fill -k choose test path",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"Cancun",
"--evm-bin",
"${input:evmBinary}",
"-v",
"-k",
"${input:testPathOrId}"
],
"cwd": "${workspaceFolder}"
},
{
"label": "Geth, danceratopz's repo",
"value": "~/code/github/danceratopz/go-ethereum/build/bin/evm",
"name": "Launch fill --until Cancun",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"Cancun",
"--evm-bin",
"${input:evmBinary}",
"-v"
],
"cwd": "${workspaceFolder}"
},
{
"label": "evmone",
"value": "~/code/github/ethereum/evmone/build/bin/evmone-t8n",
"name": "Launch fill --until Prague",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"args": [
"-c",
"pytest.ini",
"--until",
"Prague",
"--evm-bin",
"${input:evmBinary}",
"-v"
],
"cwd": "${workspaceFolder}"
}
],
"inputs": [
{
"type": "pickString",
"id": "evmBinary",
"description": "Which evm binary to you want to run?",
"options": [
{
"label": "First evm binary in PATH",
"value": "evm"
},
{
"label": "Geth, mario's repo",
"value": "~/code/github/marioevz/go-ethereum/build/bin/evm"
},
{
"label": "Geth, danceratopz's repo",
"value": "~/code/github/danceratopz/go-ethereum/build/bin/evm"
},
{
"label": "evmone",
"value": "~/code/github/ethereum/evmone/build/bin/evmone-t8n"
},
{
"label": "besu",
"value": "~/code/github/danceratopz/besu/ethereum/evmtool/build/install/evmtool/bin/evm"
}
],
"default": "evm"
},
{
"type": "pickString",
"id": "fork",
"description": "Which fork do you want to use?",
"options": [
"Frontier",
"Homestead",
"Byzantium",
"Constantinople",
"ConstantinopleFix",
"Istanbul",
"Berlin",
"London",
"Paris",
"Shanghai",
"Cancun",
"Prague"
],
"default": "Cancun"
},
{
"label": "besu",
"value": "~/code/github/danceratopz/besu/ethereum/evmtool/build/install/evmtool/bin/evm",
"type": "promptString",
"id": "testPathOrId",
"description": "Enter a test path string or id to provide to pytest -k",
"default": "test_"
}
],
"default": "evm"
},
{
"type": "pickString",
"id": "fork",
"description": "Which fork do you want to use?",
"options": [
"Frontier",
"Homestead",
"Byzantium",
"Constantinople",
"ConstantinopleFix",
"Istanbul",
"Berlin",
"London",
"Paris",
"Shanghai",
"Cancun",
"Prague",
],
"default": "Cancun"
},
{
"type": "promptString",
"id": "testPathOrId",
"description": "Enter a test path string or id to provide to pytest -k",
"default": "test_"
}
]
}
]
}
29 changes: 29 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// Static settings that users MUST adhere to when
// developing with the EEST repo.
"cSpell.customDictionaries": {
"project-words": {
"name": "project-words",
"path": "${workspaceRoot}/whitelist.txt",
"description": "Words used in this project",
"addWords": true
},
"custom": true,
"internal-terms": false
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
"editor.rulers": [100],
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
},
"python.analysis.autoFormatStrings": true,
"ruff.enable": true,
"ruff.lint.args": ["--line-length", "99", "--fix"],
"extensions.ignoreRecommendations": false
}
Loading
Loading