Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and add tests for configure_vscode script
Browse files Browse the repository at this point in the history
- Fix wrong python attribute used in `configure_vscode.py`.
- Add CI/CD tests to verify the script works to detect errors earlier.
undergroundwires committed May 3, 2024
1 parent 8c17396 commit 44f84e2
Showing 2 changed files with 37 additions and 1 deletion.
36 changes: 36 additions & 0 deletions .github/workflows/checks.scripts.yaml
Original file line number Diff line number Diff line change
@@ -53,3 +53,39 @@ jobs:
-
name: Run install-deps
run: ${{ matrix.install-command }}

configure-vscode:
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ macos, ubuntu, windows ]
fail-fast: false # Still interested to see results from other combinations
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
-
name: Install VSCode on macOS
if: matrix.os == 'macos'
run: brew install --cask visual-studio-code
-
name: Install VSCode on Linux
if: matrix.os == 'ubuntu'
run: flatpak install flathub com.visualstudio.code
-
name: Install VSCode on Windows
if: matrix.os == 'windows'
run: |-
scoop bucket add extras
scoop install vscode
-
name: Install dependencies
uses: ./.github/actions/npm-install-dependencies
-
name: Create icons
run: npm run icons:build
2 changes: 1 addition & 1 deletion scripts/configure_vscode.py
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ def remove_json_comments(json_like: str) -> str:
pattern: str = r'(?:"(?:\\.|[^"\\])*"|/\*[\s\S]*?\*/|//.*)|([^:]//.*$)'
return re.sub(
pattern,
lambda m: '' if m.group(1) else m.agroup(0), json_like, flags=re.MULTILINE,
lambda m: '' if m.group(1) else m.group(0), json_like, flags=re.MULTILINE,
)

def install_vscode_extensions(vscode_cli_path: str, extensions: list[str]) -> None:

0 comments on commit 44f84e2

Please sign in to comment.