mypy 関連のメモ
- mypy.ini をプロジェクトディレクトリ直下に配置する
follow_imports
は normal が推奨かつデフォルトらしい。ignore_missing_imports
は有効の方が良さげ。show_column_numbers
はTrue
で良さそう。pretty
はデフォルト通り無効化で良い。- VSCode ワークスペース設定では以下の設定を行う
{ ... // 自動保存 "files.autoSave": "afterDelay", "files.autoSaveDelay": 1000, // mypy 設定 "python.linting.mypyEnabled": true, "python.linting.mypyPath": "${workspaceFolder}/.venv/bin/mypy", "python.linting.mypyArgs": [ "--config-file=${workspaceFolder}/mypy.ini", ], ... }