-
-
Notifications
You must be signed in to change notification settings - Fork 13
Check vscode extension sync #257
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
Open
Tatianah3
wants to merge
18
commits into
main
Choose a base branch
from
feature/check-vscode-extension-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
e22990c
Add VSCode extension sync check to CI and pre-commit
github-actions[bot] 88ae927
Cleaning documents
github-actions[bot] 5fc7625
Cleaning documents
github-actions[bot] 33bfca2
Adding improvements
github-actions[bot] 654d60c
Solving script sintax issue
github-actions[bot] fe7a42c
Update Justfile
Tatianah3 fa1705d
Update scripts/check_extension_sync.py
Tatianah3 d5b73f0
Merge branch 'main' into feature/check-vscode-extension-sync
smorin 1583fb4
Merge branch 'main' into feature/check-vscode-extension-sync
smorin 0be0d88
Merge branch 'main' into feature/check-vscode-extension-sync
Tatianah3 7ab3d46
Update Justfile
Tatianah3 467a154
Update .github/workflows/ci.yaml
Tatianah3 9275f89
Update scripts/check_extension_sync.py
Tatianah3 075c687
Update devcontainer and Justfile
github-actions[bot] 125de43
Update pre-commit hook versions
github-actions[bot] fb902cb
Update .pre-commit-config.yaml
Tatianah3 d0ab4aa
Remove trailing whitespace from pre-commit config
github-actions[bot] 08ff1c3
Fix ruff C401, remove Unicode, and ensure formatting for pre-commit
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "name": "PyLaunch Blueprint", | ||
| "build": { | ||
| "dockerfile": "Dockerfile", | ||
| "context": ".." | ||
| }, | ||
| "customizations": { | ||
| "vscode": { | ||
| "extensions": [ | ||
| "ms-python.python", | ||
| "ms-python.vscode-pylance", | ||
| "ms-python.black-formatter", | ||
| "charliermarsh.ruff", | ||
| "matangover.mypy", | ||
| "tamasfe.even-better-toml", | ||
| "redhat.vscode-yaml", | ||
| "eamodio.gitlens", | ||
| "streetsidesoftware.code-spell-checker" | ||
| ] | ||
| } | ||
| }, | ||
| "postCreateCommand": "bash .devcontainer/setup.sh", | ||
| "remoteUser": "vscode" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,4 +92,4 @@ jobs: | |
| # run: | | ||
| # uv pip install build twine | ||
| # python -m build | ||
| # twine upload dist/* | ||
| # twine upload dist/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| import json | ||
| import sys | ||
| from pathlib import Path | ||
| from typing import Dict, Set, Any | ||
|
|
||
| EXTENSIONS_FILE = Path(".vscode/extensions.json") | ||
| DEVCONTAINER_FILE = Path(".devcontainer/devcontainer.json") | ||
|
|
||
|
|
||
| def load_json(file_path: Path) -> Dict[str, Any]: | ||
| try: | ||
| with open(file_path) as f: | ||
| return json.load(f) | ||
| except FileNotFoundError: | ||
| print(f"❌ Error: {file_path} not found.") | ||
| sys.exit(2) | ||
| except json.JSONDecodeError as e: | ||
| print(f"❌ Error parsing {file_path}: {e}") | ||
| sys.exit(2) | ||
|
|
||
Tatianah3 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| def extract_recommended_extensions(data: Dict[str, Any]) -> Set[str]: | ||
| return set(data.get("recommendations", [])) | ||
|
|
||
|
|
||
| def extract_devcontainer_extensions(data: Dict[str, Any]) -> Set[str]: | ||
| try: | ||
| return set( | ||
| ext if isinstance(ext, str) else ext["id"] | ||
| for ext in data["customizations"]["vscode"]["extensions"] | ||
| ) | ||
| except KeyError: | ||
| return set() | ||
|
|
||
|
|
||
| def main() -> None: | ||
| vscode_data = load_json(EXTENSIONS_FILE) | ||
| devcontainer_data = load_json(DEVCONTAINER_FILE) | ||
|
|
||
| vscode_exts = extract_recommended_extensions(vscode_data) | ||
| dev_exts = extract_devcontainer_extensions(devcontainer_data) | ||
|
|
||
| missing = vscode_exts - dev_exts | ||
|
|
||
| if missing: | ||
| print("❌ VSCode extensions not synced with devcontainer configuration!\n") | ||
| print("Missing from .devcontainer/devcontainer.json:") | ||
| for ext in sorted(missing): | ||
| print(f"- {ext}") | ||
| print("\nTo fix: Add these extensions to the `customizations.vscode.extensions` array in `.devcontainer/devcontainer.json`") | ||
| sys.exit(1) | ||
|
|
||
| print("✅ VSCode extensions are in sync.") | ||
| sys.exit(0) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.