|
1 | 1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: |
2 | 2 | // https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/python-3 |
3 | 3 | { |
4 | | - "name": "Django GCP", |
| 4 | + "name": "Django Twined", |
| 5 | + |
5 | 6 | "dockerComposeFile": ["docker-compose.yml", "docker-compose.developer.yml"], |
6 | 7 | "service": "web", |
7 | 8 | "workspaceFolder": "/workspace", |
|
10 | 11 | "customizations": { |
11 | 12 | "vscode": { |
12 | 13 | "settings": { |
13 | | - "austin.mode": "Wall time", |
| 14 | + "[python]": { |
| 15 | + "editor.defaultFormatter": "ms-python.black-formatter", |
| 16 | + "editor.formatOnSave": true, |
| 17 | + "editor.codeActionsOnSave": { |
| 18 | + "source.organizeImports": "always", |
| 19 | + "source.fixAll": "always" |
| 20 | + } |
| 21 | + }, |
14 | 22 | "black-formatter.args": ["--line-length", "120"], |
| 23 | + "black-formatter.importStrategy": "fromEnvironment", |
| 24 | + "isort.args": ["--profile", "black"], |
| 25 | + "isort.importStrategy": "fromEnvironment", |
| 26 | + "austin.mode": "Wall time", |
15 | 27 | "editor.defaultFormatter": "esbenp.prettier-vscode", |
16 | 28 | "editor.formatOnSave": true, |
17 | | - "esbonio.server.enabled": true, |
18 | | - "esbonio.sphinx.confDir": "${workspaceFolder}/docs/source", |
19 | 29 | "jupyter.widgetScriptSources": ["jsdelivr.com", "unpkg.com"], |
20 | | - "prettier.prettierPath": "/usr/local/prettier", |
21 | | - "python.defaultInterpreterPath": "/usr/local/bin/python", |
22 | | - "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", |
23 | | - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", |
24 | | - "python.formatting.provider": "black", |
25 | | - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", |
26 | | - "python.languageServer": "Pylance", |
27 | | - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", |
28 | | - "python.linting.enabled": true, |
29 | | - "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", |
30 | | - "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", |
31 | | - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", |
32 | | - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", |
33 | | - // Disabling specific messages: |
| 30 | + // Line length to match black settings |
| 31 | + // Disable specific messages: |
34 | 32 | // - To find the details do: /usr/local/py-utils/bin/pylint --list-msgs |
35 | 33 | // - Disable missing-module-docstring (C0114) because we don't document modules routinely, just their members |
36 | 34 | // - Disable invalid-name (C0103) because pylint thinks that eg 'x', 'df', 'np' are invalid due to their lengths |
37 | | - "python.linting.pylintArgs": [ |
| 35 | + "pylint.args": [ |
38 | 36 | "--max-line-length=120", |
39 | | - "--disable=missing-module-docstring,invalid-name" |
40 | | - ], |
41 | | - "python.linting.pylintEnabled": true, |
42 | | - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", |
43 | | - "python.pythonPath": "/usr/local/bin/python", |
44 | | - "python.testing.pytestArgs": [ |
45 | | - "--cov=django_gcp", |
46 | | - "--cov-report=xml:cov.xml" |
| 37 | + "--disable=missing-module-docstring,invalid-name", |
| 38 | + "--load-plugins=pylint_django" |
47 | 39 | ], |
48 | | - // Scrolling the editor is a nice idea but it doesn't work, always out of sync and impossible to manage |
49 | | - "restructuredtext.preview.scrollEditorWithPreview": false, |
50 | | - "restructuredtext.preview.scrollPreviewWithEditor": false, |
51 | | - "restructuredtext.linter.doc8.extraArgs": ["--max-line-length 180"], |
52 | | - "terminal.integrated.defaultProfile.linux": "zsh" |
| 40 | + "python.testing.pytestEnabled": true, |
| 41 | + "python.testing.unittestEnabled": false, |
| 42 | + "terminal.integrated.defaultProfile.linux": "zsh", |
| 43 | + // Handle this: https://github.com/microsoft/vscode-python/issues/693 |
| 44 | + "python.testing.pytestArgs": ["--no-cov"] |
53 | 45 | }, |
54 | | - |
55 | 46 | // Add the IDs of extensions you want installed when the container is created. |
56 | 47 | "extensions": [ |
57 | | - |
| 48 | + "erikphansen.vscode-toggle-column-selection", |
| 49 | + "esbenp.prettier-vscode", |
| 50 | + "GitHub.copilot", |
| 51 | + "GitHub.copilot-chat", |
| 52 | + "github.vscode-github-actions", |
58 | 53 | "irongeek.vscode-env", |
59 | | - "me-dutour-mathieu.vscode-github-actions", |
60 | | - "mikestead.dotenv", |
61 | 54 | "ms-python.python", |
62 | 55 | "ms-python.vscode-pylance", |
63 | 56 | "ms-python.pylint", |
| 57 | + "ms-python.black-formatter", |
| 58 | + "ms-python.flake8", |
| 59 | + "ms-python.isort", |
64 | 60 | "ms-toolsai.jupyter", |
65 | 61 | "ms-toolsai.jupyter-renderers", |
66 | 62 | "ms-toolsai.jupyter-keymap", |
|
70 | 66 | "shamanu4.django-intellisense", |
71 | 67 | "thebarkman.vscode-djaneiro", |
72 | 68 | "trond-snekvik.simple-rst", |
73 | | - "ms-azuretools.vscode-docker", |
74 | | - "ryanluker.vscode-coverage-gutters", |
75 | | - "ms-python.black-formatter" |
| 69 | + "4ops.terraform" |
76 | 70 | ] |
77 | 71 | } |
78 | 72 | }, |
79 | 73 |
|
80 | 74 | // Use 'forwardPorts' to make a list of ports inside the container available locally. |
81 | 75 | "forwardPorts": [80, 443, 5000, 7045, 7046, 7047, 7048, 7049, 8000, 8080], |
82 | 76 |
|
83 | | - // Use 'postCreateCommand' to run commands after the container is created. |
84 | | - // Note: Reverting to use pip requirements until we can install private dependencies in GHA with poetry |
85 | | - "postCreateCommand": ". .devcontainer/postcreate.sh", |
| 77 | + // Use 'postAttachCommand' to run commands after the container is created and attached (ie git is available). |
| 78 | + // This is preferential to postCreateCommand as invoking git (eg for private poetry installs or addition of |
| 79 | + // git config preferences) doesn't override injected git configs |
| 80 | + // https://stackoverflow.com/a/73097009/3556110 |
| 81 | + "postAttachCommand": ". .devcontainer/postattach.sh", |
86 | 82 |
|
87 | 83 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
88 | 84 | "remoteUser": "vscode", |
|
114 | 110 | "ghcr.io/devcontainers/features/node:1": { |
115 | 111 | "nodeGypDependencies": false, |
116 | 112 | "version": "latest" |
117 | | - }, |
118 | | - "ghcr.io/dhoeric/features/google-cloud-cli:1": {} |
| 113 | + } |
119 | 114 | } |
120 | 115 | } |
0 commit comments