Skip to content

Commit 9f95f1f

Browse files
committed
chore(devcontainer): clean up build, settings, pre-commit install
- copy git directory for version metadata - move pre-commit install to postAttach - clean up deprecated settings
1 parent bca0293 commit 9f95f1f

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,5 @@ COPY docs/requirements.txt docs/requirements.txt
55
RUN pip install --no-cache-dir -r docs/requirements.txt
66

77
# install devcontainer requirements
8+
COPY .git .git
89
RUN pip install -e .[dev,test]
9-
10-
# install pre-commit environments in throwaway Git repository
11-
# https://stackoverflow.com/a/68758943
12-
COPY .pre-commit-config.yaml .
13-
RUN git init . && \
14-
pre-commit install-hooks && \
15-
rm -rf .git

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"service": "dev",
66
"runServices": ["dev", "docs"],
77
"workspaceFolder": "/home/calitp/app",
8+
"postAttachCommand": ["/bin/bash", ".devcontainer/postAttach.sh"],
89
"postStartCommand": ["/bin/bash", "bin/init.sh"],
910
"customizations": {
1011
// Set *default* container specific settings.json values on container create.

.devcontainer/postAttach.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
pre-commit install --install-hooks

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
"[python]": {
1010
"editor.defaultFormatter": "ms-python.black-formatter"
1111
},
12-
"python.formatting.provider": "none",
1312
"python.languageServer": "Pylance",
14-
"python.linting.enabled": true,
15-
"python.linting.flake8Enabled": true,
1613
"python.testing.pytestArgs": ["tests"],
1714
"python.testing.pytestEnabled": true,
1815
"python.testing.unittestEnabled": false,

0 commit comments

Comments
 (0)