-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 @@ | ||
COMPOSE_PROJECT_NAME="devcontainer-filter-pre-commit-hooks" |
This file contains 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,38 @@ | ||
FROM mcr.microsoft.com/devcontainers/python:latest | ||
|
||
USER vscode | ||
|
||
# Install additional packages with APT. | ||
RUN <<-EOT | ||
set -eux | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt-get update | ||
sudo apt-get install --yes --no-install-recommends \ | ||
curl \ | ||
dnsutils \ | ||
gnupg2 | ||
EOT | ||
|
||
# Install additional packages with pipx. | ||
RUN <<-EOT | ||
set -eux | ||
|
||
pipx install \ | ||
copier \ | ||
pre-commit \ | ||
uv | ||
EOT | ||
|
||
# Install Task with the official installer. | ||
# Set up completion in Bash. | ||
RUN <<-EOT | ||
set -eux | ||
curl \ | ||
--location --silent --show-error --fail \ | ||
--output /tmp/taskfile-installer.sh \ | ||
https://taskfile.dev/install.sh | ||
mkdir -p ~/.local/bin | ||
sh /tmp/taskfile-installer.sh -d -b ~/.local/bin | ||
mkdir -p ~/.local/share/bash-completion/completions | ||
task --completion bash > ~/.local/share/bash-completion/completions/task | ||
EOT |
This file contains 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,5 @@ | ||
# Devcontainer | ||
|
||
This projects supports [Development Containers](https://containers.dev/). | ||
|
||
The dev container is made to be used with Visual Studio Code. |
This file contains 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,28 @@ | ||
{ | ||
"name": "filter-pre-commit-hooks", | ||
|
||
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
|
||
"dockerComposeFile": "docker-compose.yaml", | ||
|
||
"service": "vscode", | ||
|
||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"tamasfe.even-better-toml", | ||
"charliermarsh.ruff", | ||
"ms-python.python", | ||
"task.vscode-task", | ||
"Tyriar.sort-lines" | ||
] | ||
} | ||
}, | ||
|
||
"postCreateCommand": { | ||
"fixVolumePreCommitCache": "sudo chown -R vscode:vscode /home/vscode/.cache/pre-commit", | ||
"fixVolumeUvCache": "sudo chown -R vscode:vscode /home/vscode/.cache/uv" | ||
}, | ||
|
||
"postStartCommand": "task init", | ||
} |
This file contains 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,13 @@ | ||
services: | ||
vscode: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ../..:/workspaces:cached | ||
- pre-commit-cache:/home/vscode/.cache/pre-commit | ||
- uv-cache:/home/vscode/.cache/uv | ||
command: sleep infinity | ||
volumes: | ||
pre-commit-cache: | ||
uv-cache: |