chore: add a devcontainer setup #50
@@ -1,7 +0,0 @@
|
|||||||
# .devcontainer/Dockerfile
|
|
||||||
FROM mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye
|
|
||||||
|
|
||||||
# CACHED INSTALLATION:
|
|
||||||
# Install global NPM packages here. This creates a cached Docker layer.
|
|
||||||
# We use 'su node' to ensure permissions are correct for the non-root user.
|
|
||||||
RUN su node -c "npm install -g @google/gemini-cli"
|
|
||||||
@@ -1,17 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "Gemini Agent Quality Ops",
|
"name": "JS Dev Container",
|
||||||
"build": {
|
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20",
|
||||||
"dockerfile": "Dockerfile"
|
|
||||||
},
|
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/python:1": {
|
|
||||||
"version": "3.11",
|
|
||||||
"installTools": true,
|
|
||||||
"optimize": true
|
|
||||||
},
|
|
||||||
"ghcr.io/devcontainers/features/git:1": {},
|
"ghcr.io/devcontainers/features/git:1": {},
|
||||||
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
"ghcr.io/devcontainers/features/git-lfs:1": {},
|
||||||
"ghcr.io/devcontainers-extra/features/pre-commit:2": {}
|
"ghcr.io/devcontainers-extra/features/pre-commit:2": {},
|
||||||
|
"ghcr.io/devcontainers-extra/features/npm-packages:1": {
|
||||||
|
"packages": "@google/gemini-cli"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
@@ -29,12 +25,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"postStartCommand": "bash .devcontainer/setup.sh",
|
"postStartCommand": "bash .devcontainer/setup.sh",
|
||||||
"remoteUser": "vscode",
|
"remoteUser": "node",
|
||||||
"updateRemoteUserUID": true,
|
"updateRemoteUserUID": true,
|
||||||
"mounts": [
|
"mounts": [
|
||||||
"source=pipx-venvs,target=/home/node/.local/share/pipx,type=volume",
|
"source=pipx-venvs,target=/home/node/.local/share/pipx,type=volume",
|
||||||
"source=pipx-bin,target=/home/node/.local/bin,type=volume",
|
"source=pipx-bin,target=/home/node/.local/bin,type=volume",
|
||||||
"source=pre-commit-cache,target=/home/node/.cache/pre-commit,type=volume",
|
"source=pre-commit-cache,target=/home/node/.cache/pre-commit,type=volume",
|
||||||
"source=${localEnv:USERPROFILE}/.gemini,target=/home/node/.gemini,type=bind"
|
"source=${localEnv:USERPROFILE}/.gemini,target=/home/node/.gemini,type=bind",
|
||||||
|
"source=gvscode-extensions,target=/home/node/.cache/google-vscode-extension,type=volume"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@
|
|||||||
# 1. Fix Git Permissions (Critical in Docker)
|
# 1. Fix Git Permissions (Critical in Docker)
|
||||||
git config --global --add safe.directory $(pwd)
|
git config --global --add safe.directory $(pwd)
|
||||||
|
|
||||||
|
# In your setup.sh or postCreateCommand
|
||||||
|
sudo chown -R node:node /home/node/.cache/
|
||||||
|
|
||||||
# 2. Re-connect Git Hooks
|
# 2. Re-connect Git Hooks
|
||||||
if command -v pre-commit &> /dev/null; then
|
pre-commit install
|
||||||
pre-commit install
|
pre-commit install-hooks
|
||||||
else
|
|
||||||
echo "⚠️ Warning: pre-commit not found. Skipping hook installation."
|
|
||||||
fi
|
|
||||||
|
|||||||
@@ -1,57 +1,48 @@
|
|||||||
exclude: ^node_modules/
|
exclude: ^node_modules/
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v6.0.0
|
rev: v6.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
exclude: (.txt$|.ipynb$|README.md$|readme.mde$)
|
exclude: (.txt$|.ipynb$|README.md$|readme.mde$)
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
exclude: (.txt$|README.md$)
|
exclude: (.txt$|README.md$)
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: check-json
|
- id: check-json
|
||||||
- id: check-toml
|
- id: check-toml
|
||||||
- id: check-xml
|
- id: check-xml
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
args: [--enforce-all]
|
args: [--enforce-all]
|
||||||
- id: name-tests-test
|
- id: name-tests-test
|
||||||
- id: detect-private-key
|
- id: detect-private-key
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-symlinks
|
- id: check-symlinks
|
||||||
- id: check-docstring-first
|
- id: check-docstring-first
|
||||||
- id: pretty-format-json
|
- id: pretty-format-json
|
||||||
args: [--autofix, --no-sort-keys, --no-ensure-ascii]
|
args: [--autofix, --no-sort-keys, --no-ensure-ascii]
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: no-commit-to-branch
|
- id: no-commit-to-branch
|
||||||
args: [--branch, main]
|
args: [--branch, main]
|
||||||
|
|
||||||
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
|
||||||
rev: v2.15.0
|
rev: v2.15.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pretty-format-ini
|
- id: pretty-format-ini
|
||||||
args: [--autofix]
|
args: [--autofix]
|
||||||
- id: pretty-format-toml
|
- id: pretty-format-toml
|
||||||
args: [--autofix]
|
args: [--autofix]
|
||||||
- id: pretty-format-yaml
|
- id: pretty-format-yaml
|
||||||
args: [--autofix]
|
args: [--autofix]
|
||||||
|
|
||||||
- repo: https://github.com/frnmst/md-toc
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
||||||
rev: 9.0.0
|
rev: v4.0.0-alpha.8
|
||||||
hooks:
|
hooks:
|
||||||
- id: md-toc
|
- id: prettier
|
||||||
|
types_or: [css, javascript]
|
||||||
- repo: https://github.com/Lucas-C/pre-commit-hooks-java
|
|
||||||
rev: 1.3.10
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
||||||
hooks:
|
rev: 0.36.0
|
||||||
- id: validate-html
|
hooks:
|
||||||
|
- id: check-renovate
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
- id: check-github-actions
|
||||||
rev: v4.0.0-alpha.8
|
- id: check-github-workflows
|
||||||
hooks:
|
|
||||||
- id: prettier
|
|
||||||
types_or: [css, javascript]
|
|
||||||
|
|
||||||
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
||||||
rev: 0.36.0
|
|
||||||
hooks:
|
|
||||||
- id: check-renovate
|
|
||||||
- id: check-github-actions
|
|
||||||
|
|||||||
Reference in New Issue
Block a user