Skip to content

Commit b6b2df6

Browse files
committed
chore(docs): update ruff in docs.
1 parent 161b8bc commit b6b2df6

File tree

2 files changed

+26
-21
lines changed

2 files changed

+26
-21
lines changed

docs/getting_started/setup_vs_code.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
VS Code setup is optional, but does offer the following advantages:
44

5-
- Auto-format your Python code to conform to the repository's [code standards](../writing_tests/code_standards.md) ([black](https://black.readthedocs.io/en/stable/)).
5+
- Auto-format your Python code to conform to the repository's [code standards](../writing_tests/code_standards.md) ([ruff](https://docs.astral.sh/ruff/)).
66
- Inline linting and auto-completion (thanks to Python type hints).
77
- Spell-check your code and docs.
88
- Graphical exploration of test cases and easy test execution/debug.
@@ -18,38 +18,47 @@ The [ethereum/execution-spec-tests](https://github.com/ethereum/execution-spec-t
1818
```text
1919
📁 execution-test-specs/
2020
└──📁 .vscode/
21-
├── 📄 settings.recommended.json
21+
├── 📄 settings.json
22+
├── 📄 settings.local.recommended.json
2223
├── 📄 extensions.json
2324
└── 📄 launch.recommended.json
2425
```
2526

26-
To enable the recommended settings, copy the settings file to the expected location:
27+
By default the repository settings are applied via `.vscode/settings.json`, if you want to add your own settings please edit `.vscode/settings.local.recommended.json`.
28+
29+
To enable the recommended launch configurations:
2730

2831
```console
29-
cp .vscode/settings.recommended.json .vscode/settings.json
32+
cp .vscode/launch.recommended.json .vscode/launch.json
3033
```
3134

32-
To additionally enable the recommended launch configurations:
35+
To additionally use and add local settings please run the following first:
3336

3437
```console
35-
cp .vscode/launch.recommended.json .vscode/launch.json
38+
cp .vscode/settings.local.recommended.json .vscode/settings.local.json
3639
```
3740

3841
## Additional VS Code Extensions
3942

4043
Open the folder in VS Code where execution-spec-tests is cloned: VS Code should prompt to install the repository's required extensions from `.vscode/extensions.json`:
4144

4245
- [`ms-python.python`](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
43-
- [`ms-python.isort`](https://marketplace.visualstudio.com/items?itemName=ms-python.isort)
44-
- [`ms-python.flake8`](https://marketplace.visualstudio.com/items?itemName=ms-python.flake8)
45-
- [`ms-python.black-formatter`](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter)
46+
- [`charliermarsh.ruff`](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
4647
- [`esbenp.prettier-vscode`](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
4748
- [`streetsidesoftware.code-spell-checker`](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
4849
- [`tamasfe.even-better-toml`](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml)
4950

5051
!!! note "Workspace Trust"
5152
Trust the `execution-specs-test` repository when opening in VS Code to be prompted to install the plugins recommended via the `extensions.json` file.
5253

54+
The `.vscode/extensions.json` additionally contains a list of extensions that should be disabled:
55+
56+
- [`ms-python.isort`](https://marketplace.visualstudio.com/items?itemName=ms-python.isort)
57+
- [`ms-python.flake8`](https://marketplace.visualstudio.com/items?itemName=ms-python.flake8)
58+
- [`ms-python.black-formatter`](https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter)
59+
60+
Please ensure that these are disabled for the repo if they are installed as part of your VS Code extensions.
61+
5362
## Configuration for Testing EVM Features Under Active Development
5463

5564
An additional step is required to enable fixture generations for features from forks that are under active development and have not been deployed to mainnet, see [Filling Tests for Features under Development](../filling_tests/filling_tests_dev_fork.md#vs-code-setup).

docs/writing_tests/code_standards.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ The Python code in the tests subdirectory `./tests` must fulfill the following c
44

55
| | Command | Explanation |
66
|---|-------------------------|--------------------------------------------------------------------------|
7-
| 1 | `fname8 tests` | Spell check passes using the `./whitelist.txt` dictionary file. |
8-
| 2 | `isort tests --check --diff` | Python imports ordered and arranged according to isort's standards. |
9-
| 3 | `black tests --check --diff` | Python source must be black-formatted. |
10-
| 4 | `flake8 tests` | Python lint and spell-checked. |
11-
| 5 | `mypy tests` | Objects that provide typehints pass type-checking via mypy. |
12-
| 6 | `fill` | All tests must execute correctly. |
13-
| 7 | `mkdocs build --strict` | Documentation generated without warnings. |
14-
| 8 | `pyspelling` | Markdown spell-check. |
15-
| 9 | `markdownlint-cli2` | Markdown lint check. |
7+
| 1 | `ruff check tests` | Python lint, format and imports check. |
8+
| 2 | `mypy tests` | Objects that provide typehints pass type-checking via mypy. |
9+
| 3 | `fill` | All tests must execute correctly. |
10+
| 4 | `mkdocs build --strict` | Documentation generated without warnings. |
11+
| 5 | `pyspelling` | Markdown spell-check. |
12+
| 6 | `markdownlint-cli2` | Markdown lint check. |
1613

17-
While this seems like a long list, a correctly configured editor (see [VS Code Setup](../getting_started/setup_vs_code.md)) essentially assures:
14+
While this seems like a long list, a correctly configured editor (see [VS Code Setup](../getting_started/setup_vs_code.md)) essentially assures that all points are mostly covered.
1815

19-
1. Points 2 and 3 are automatically covered.
20-
2. Points 1, 4, 5, 8 & 9 are mostly covered. Additionally, if you skip type hints, they won't be checked; we can help you add these in the PR.
16+
Additionally, if you skip type hints, they won't be checked; we can help you add these in the PR.
2117

2218
These checks must pass in order for the execution-spec-tests Github Actions to pass upon pushing to remote.
2319

0 commit comments

Comments
 (0)