From 2d6a61303231d7a7425ca4bdab86e0cd346690bf Mon Sep 17 00:00:00 2001 From: SKairinos Date: Mon, 4 Mar 2024 12:49:15 +0000 Subject: [PATCH] configure submodule --- .devcontainer.json | 54 ++++++++++------------- .vscode/codeforlife.code-snippets | 35 +++++++++++++++ .vscode/launch.json | 37 +++++++++------- .vscode/settings.json | 71 ++++++++++++++++++++++++++++++- codeforlife.code-workspace | 14 ++++++ 5 files changed, 162 insertions(+), 49 deletions(-) create mode 100644 .vscode/codeforlife.code-snippets create mode 100644 codeforlife.code-workspace diff --git a/.devcontainer.json b/.devcontainer.json index f9feac392..b52d3dcbd 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,48 +1,40 @@ { - "name": "portal", - "dockerComposeFile": [ - "../docker-compose.yml" - ], - "service": "base-service", - "shutdownAction": "none", - "workspaceFolder": "/workspace/codeforlife-portal", - "remoteUser": "root", - "postCreateCommand": "pipenv install --dev", - "features": { - "ghcr.io/devcontainers/features/python:1": { - "version": "3.8", - "installTools": false - }, - "ghcr.io/devcontainers-contrib/features/pipenv:2": { - "version": "2023.11.15" - } - }, "customizations": { "vscode": { - //TODO: Specify preferred settings and extensions once defined - "settings": { - "python.defaultInterpreterPath": ".venv/bin/python" - }, "extensions": [ + "visualstudioexptteam.vscodeintellicode", "github.vscode-pull-request-github", "redhat.vscode-yaml", "davidanson.vscode-markdownlint", "bierner.markdown-mermaid", + "streetsidesoftware.code-spell-checker", "ms-python.python", + "ms-python.debugpy", "ms-python.pylint", "ms-python.isort", "ms-python.vscode-pylance", "ms-python.mypy-type-checker", "ms-python.black-formatter", - "streetsidesoftware.code-spell-checker", - "tamasfe.even-better-toml", - "kevinrose.vsc-python-indent", - "batisteo.vscode-django", - "njpwerner.autodocstring", - "visualstudioexptteam.vscodeintellicode", - "wholroyd.jinja", - "qwtel.sqlite-viewer" + "qwtel.sqlite-viewer", + "njpwerner.autodocstring" ] } - } + }, + "dockerComposeFile": [ + "../docker-compose.yml" + ], + "features": { + "ghcr.io/devcontainers-contrib/features/pipenv:2": { + "version": "2023.11.15" + }, + "ghcr.io/devcontainers/features/python:1": { + "installTools": false, + "version": "3.8" + } + }, + "name": "portal", + "remoteUser": "root", + "service": "base-service", + "shutdownAction": "none", + "workspaceFolder": "/workspace/codeforlife-portal" } \ No newline at end of file diff --git a/.vscode/codeforlife.code-snippets b/.vscode/codeforlife.code-snippets new file mode 100644 index 000000000..c54a2b164 --- /dev/null +++ b/.vscode/codeforlife.code-snippets @@ -0,0 +1,35 @@ +{ + "python.module.docstring": { + "body": [ + "\"\"\"", + "\u00a9 Ocado Group", + "Created on $CURRENT_DATE/$CURRENT_MONTH/$CURRENT_YEAR at $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND($CURRENT_TIMEZONE_OFFSET).", + "", + "${1:__description__}", + "\"\"\"" + ], + "prefix": [ + "\"\"\"", + "'''" + ], + "scope": "python" + }, + "python.mypy.ignore": { + "body": [ + "# type: ignore[${1:__code_name__}]" + ], + "prefix": [ + "# type" + ], + "scope": "python" + }, + "python.pylint.disable-next": { + "body": [ + "# pylint: disable-next=${1:__code_name__}" + ], + "prefix": [ + "# pylint" + ], + "scope": "python" + } +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 3b15f64cf..6f185c78a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,29 +1,34 @@ { - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", "configurations": [ { - "name": "Django Server", - "type": "python", - "request": "launch", - "django": true, - "justMyCode": false, - "program": "${workspaceFolder}/example_project/manage.py", "args": [ "runserver", "localhost:8000" - ] + ], + "django": true, + "justMyCode": false, + "name": "Django Server", + "program": "${workspaceFolder}/example_project/manage.py", + "request": "launch", + "type": "debugpy" }, { - "name": "Pytest", - "type": "python", - "request": "test", + "console": "integratedTerminal", "justMyCode": false, + "name": "Python: Current File", + "program": "${file}", + "request": "launch", + "type": "debugpy" + }, + { + "justMyCode": false, + "name": "Pytest", "presentation": { "hidden": true - } + }, + "request": "test", + "type": "debugpy" } - ] + ], + "version": "0.2.0" } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 97db8c0f3..c6a4edd52 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,71 @@ { - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true + "[md]": { + "editor.tabSize": 4 + }, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter", + "editor.tabSize": 4 + }, + "black-formatter.args": [ + "--config", + "pyproject.toml" + ], + "black-formatter.path": [ + ".venv/bin/python", + "-m", + "black" + ], + "cSpell.words": [ + "codeforlife", + "klass", + "ocado", + "kurono", + "pipenv" + ], + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, + "editor.formatOnSave": true, + "editor.rulers": [ + 80 + ], + "editor.tabSize": 2, + "files.exclude": { + "**/.hypothesis": true, + "**/.mypy_cache": true, + "**/.pytest_cache": true, + "**/__pycache__": true + }, + "isort.args": [ + "--settings-file=pyproject.toml" + ], + "isort.path": [ + ".venv/bin/python", + "-m", + "isort" + ], + "mypy-type-checker.args": [ + "--config-file=pyproject.toml" + ], + "mypy-type-checker.path": [ + ".venv/bin/python", + "-m", + "mypy" + ], + "pylint.args": [ + "--rcfile=pyproject.toml" + ], + "pylint.path": [ + ".venv/bin/python", + "-m", + "pylint" + ], + "python.defaultInterpreterPath": ".venv/bin/python", + "python.testing.pytestArgs": [ + "-n=auto", + "-c=pyproject.toml", + "." + ], + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": false } \ No newline at end of file diff --git a/codeforlife.code-workspace b/codeforlife.code-workspace new file mode 100644 index 000000000..547da3b33 --- /dev/null +++ b/codeforlife.code-workspace @@ -0,0 +1,14 @@ +{ + "folders": [ + { + "name": "portal", + "path": "." + } + ], + "settings": { + "autoDocstring.customTemplatePath": ".vscode/extensions/autoDocstring/docstring.mustache", + "workbench.colorCustomizations": { + "editorRuler.foreground": "#008000" + } + } +} \ No newline at end of file