ハマってしまってここにたどり着くまで全pyi
ファイルに# fmt: off
を書くという愚かしいことをしてしまった。
これで保存時に...py
ファイルはフォーマットされて、...pyi
ファイルはフォーマットされなくなる。
settings.json
{
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "basic",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": false,
"[python]": {
"editor.formatOnType": true,
"editor.formatOnSave": true
},
"python.formatting.provider": "black"
}
pyprpject.toml
[tool.black]
line-length = 100
force-exclude = '\.pyi$'
Python
: 3.9.4
black
: 20.8b1