From b6b59f053eb09d3317247d33f559ddec7a38df51 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 31 Jul 2023 14:11:19 -0700 Subject: [PATCH 1/2] Add tool configuration for mypy Signed-off-by: Mattt Zmuda --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f984f492..10d43f82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,10 @@ testpaths = "tests/" [tool.setuptools.package-data] "replicate" = ["py.typed"] +[tool.mypy] +plugins = "pydantic.mypy" +exclude = ["tests/"] + [tool.ruff] select = [ "E", # pycodestyle error From 8dbcbb04f659edc8d944a2675642dc65dbeb3b18 Mon Sep 17 00:00:00 2001 From: Mattt Zmuda Date: Mon, 31 Jul 2023 14:11:54 -0700 Subject: [PATCH 2/2] Add suggested VSCode extensions and update project settings Signed-off-by: Mattt Zmuda --- .vscode/extensions.json | 8 ++++++++ .vscode/settings.json | 24 +++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..f5470601 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "charliermarsh.ruff", + "ms-python.black-formatter", + "ms-python.python", + "ms-python.vscode-pylance" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 834e7e48..3114d412 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,27 +1,25 @@ { - "python.formatting.provider": "black", - "python.languageServer": "Pylance", "editor.formatOnSave": true, - "python.testing.unittestEnabled": false, - "python.testing.pytestEnabled": true, "editor.formatOnType": true, "editor.formatOnPaste": true, "editor.renderControlCharacters": true, "editor.suggest.localityBonus": true, "files.insertFinalNewline": true, "files.trimFinalNewlines": true, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, "[python]": { - "editor.defaultFormatter": "ms-python.python", + "editor.formatOnSave": true, "editor.codeActionsOnSave": { + "source.fixAll": true, "source.organizeImports": true - } + }, + "editor.defaultFormatter": null }, + "python.languageServer": "Pylance", + "python.testing.pytestArgs": ["-vvv", "python"], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.formatting.provider": "black", "python.linting.mypyEnabled": true, - "python.linting.mypyArgs": ["--show-column-numbers", "--no-pretty"] + "python.linting.mypyArgs": ["--show-column-numbers", "--no-pretty"], + "ruff.args": ["--config=pyproject.toml"] }