Open3
python linter / formatter with VS Code

VS Codeでruff + black + mypyを利用する際のメモ
ruff
VS Codeのextention入れておけば pip install ruff
or poetry add ruff --group dev
しなくても利用可能
black
VS Code Extention 利用にはblackのインストール必要(pip install black
or poetry add black --group dev
)
mypy
mypy type cheker+Pylanceを入れておけば型ヒント関係はおおよそカバーできるはず。

setup.json
暫定
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.analysis.typeCheckingMode": "basic",
"python.languageServer": "Pylance",

pyproject.toml
暫定
[tool.ruff]
select = [
"E", # pycodestyle
"F", # pyflakes
"D", # pydocstyle
"B", # bugbear
"Q", # mypy
"W", # pycodestyle-warnings
"N", # pep8-naming
"SIM", # flake8-simplify
"TRY", # flake8-try
"RUF", # flake8-ruff
"I", # isort
]
ignore = ["D400", "D415", "D100"]
unfixable = [
"B",
"SIM", # flake8-simplify
"TRY", # flake8-try
"RUF", # flake8-ruff
"F841", # local variable is assigned to but never used
"F401", # imported but unused
]
line-length = 88 # Same as Black.
target-version = "py310" # Assume Python 3.10.
[tool.ruff.pydocstyle]
convention = "numpy"