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

chore,docs(tooling): remove unsupported vscode config file #1054

Merged
merged 4 commits into from
Feb 5, 2025

Conversation

danceratopz
Copy link
Member

@danceratopz danceratopz commented Jan 7, 2025

🗒️ Description

I worked with ruff #922 for the first time today (it's great 🥳), but ran into two issues:

  1. Existing extensions conflicted with the new ruff extension. This was documented, but I just updated it to make the solution more specific and easier for newcomers (unfortunately, there's no solution (yet) to disable specific extensions for a workspace in .vscode/settings.json, cf Feature Request: Enable/disable extensions from config file microsoft/vscode#40239).
  2. The docs recommended to cp .vscode/settings.local.recommended.json .vscode/settings.local.json but .vscode/settings.local.json is unsupported by VS Code and has no effect. There's an open issue for this here [Feature] Local Workspace settings microsoft/vscode#40233, otherwise see https://code.visualstudio.com/docs/getstarted/settings.

Happy to get feedback on the settings files... perhaps I missed something?

There's an outstanding issue regarding 2. #922 intentionally removed .vscode/settings.recommended.json (the settings here are now enforced in .vscode/settings.json) in order to force users to the new ruff settings. This is a good idea, but it might be a bit clunky as this file generally gets edited when switching between ethereum ./tests/ and framework tests execution (via VS Code's "Testing" Tab). This is due to our multiple pytest configurations; the required config "python.testing.pytestArgs" needs to specify the relevant pytest ini file, here's the config pre #922:

"python.testing.pytestArgs": [
// To discover tests for an upcoming fork, use the `--until` argument as following.
// "--until=Prague",
// Hopefully vscode-python will support multiple test framework environments sooon, see
// https://github.com/microsoft/vscode-python/issues/12075
// For now, to toggle between running "framework tests" and "filling tests" comment/
// uncomment the relevant line below.
"-c",
// "pytest-framework.ini",
"pytest.ini"
// "-vv"
],

🔗 Related Issues

✅ Checklist

  • All: Set appropriate labels for the changes.
  • All: Considered squashing commits to improve commit history.
  • [ ] All: Added an entry to CHANGELOG.md. skipped
  • All: Considered updating the online docs in the ./docs/ directory.
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.

@danceratopz danceratopz added scope:docs Scope: Documentation type:chore Type: Chore scope:tooling Scope: Python tools (uv, ruff, tox,...) labels Jan 7, 2025
@danceratopz danceratopz self-assigned this Jan 7, 2025
@danceratopz danceratopz force-pushed the tooling/remove-unsupported-vs-code-file branch from 8135772 to f491236 Compare January 7, 2025 16:30
@raxhvl
Copy link
Contributor

raxhvl commented Jan 7, 2025

I briefly looked into it settings.local.json is not a thing yet. It is also not yet possible to disable/whitelist an extension in a workspace using config.

@danceratopz danceratopz force-pushed the tooling/remove-unsupported-vs-code-file branch from f491236 to f027a73 Compare January 7, 2025 19:11
@danceratopz
Copy link
Member Author

I briefly looked into it settings.local.json is not a thing yet. It is also not yet possible to disable/whitelist an extension in a workspace using config.

Thanks for confirming, @raxhvl, I expanded the description and added your links!

@danceratopz danceratopz changed the title chore,docs(tooling): remove unsupported vscode config file; update docs chore,docs(tooling): remove unsupported vscode config file Jan 7, 2025
@marioevz
Copy link
Member

marioevz commented Jan 8, 2025

I'm not sure if .vscode/settings.json could be added to the gitignore file in order to be able to modify it locally and not appear as a change while still having the file in the repository, but it would be nice.

Particularly, one thing that I always add, and always pops as a change by git, is:

"python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.pytestArgs": [
        "--fork=Prague",
    ],

Or similar.

@AnrDaemon
Copy link

settings.json shouldn't be committed to the repository in first place.
This is a personal settings file. Why the… ?

@danceratopz
Copy link
Member Author

We could consider adding https://marketplace.visualstudio.com/items?itemName=nickmillerdev.pytest-fixtures to the list of recommended plugins.

@spencer-tb
Copy link
Collaborator

There is an extension that creates popups for unwanted extensions: https://marketplace.visualstudio.com/items?itemName=Soulcode.vscode-unwanted-extensions

Feel free to try it out here: https://github.com/spencer-tb/execution-spec-tests/tree/tooling/unwanted-extensions

@raxhvl
Copy link
Contributor

raxhvl commented Feb 4, 2025

That's nifty!

@danceratopz
Copy link
Member Author

There is an extension that creates popups for unwanted extensions: https://marketplace.visualstudio.com/items?itemName=Soulcode.vscode-unwanted-extensions

Feel free to try it out here: https://github.com/spencer-tb/execution-spec-tests/tree/tooling/unwanted-extensions

This works really nicely, feel free to add it to this PR!
image

@danceratopz
Copy link
Member Author

I'm not sure if .vscode/settings.json could be added to the gitignore file in order to be able to modify it locally and not appear as a change while still having the file in the repository, but it would be nice.

I think this could cause more confusion, as any changes on the remote would clobber user settings which a user didn't realise they changed (because it's gitignored).

Let's keep it as-is for now; I think it will be easier for newer contributors / test implementers. Generally, it'll be maintainers that have to make this switch and I think they can handle it easily via:

git restore .vscode/settings.json

But we should ensure that we (maintainers) settle on common settings and add them to .vscode/settings.json so no-one loses their local config unintentionally.

Particularly, one thing that I always add, and always pops as a change by git, is:

"python.testing.unittestEnabled": false,
    "python.testing.pytestEnabled": true,
    "python.testing.pytestArgs": [
        "--fork=Prague",
    ],

Or similar.

This has been added!

Copy link
Collaborator

@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 for fixing this! And apologies for this in the first place - I trust AI a bit too much sometimes!

.vscode/settings.json Outdated Show resolved Hide resolved
@danceratopz danceratopz force-pushed the tooling/remove-unsupported-vs-code-file branch from e256683 to 9192771 Compare February 5, 2025 12:48
@danceratopz danceratopz merged commit c66c916 into main Feb 5, 2025
21 checks passed
@danceratopz danceratopz deleted the tooling/remove-unsupported-vs-code-file branch February 5, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope:docs Scope: Documentation scope:tooling Scope: Python tools (uv, ruff, tox,...) type:chore Type: Chore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants