LoginSignup
0
0

VSCodeのPythonツール(リント・フォーマットなど)対応

Posted at

この対応は何か

  • VSCodeで以下の画面が表示される。
    スクリーンショット 2024-02-11 20.44.40.png
  • これの対応。

詳細情報に遷移した後のサマリ

  • Python Tools Extensionsのアップデートで、パフォーマンス、安定性、インストールの柔軟性が向上。
  • Pylint、Flake8、Mypy、Black、autopep9、isortなどの新しい拡張機能が追加された。
  • 非推奨の設定は別の拡張に移動し、代替拡張も提供されている。さらに、Ruff拡張を試したり、エクステンションの自動更新を無効にするなど、様々な非推奨設定の代替方法がある。

何をする必要があるのか

自分の場合は、

  • settings.jsonの編集。以下の設定が適用されなくなっていた。
    • これらの設定をsettings.jsonから削除することで、VSCode上の警告は出なくなる。
// linter
 "python.linting.enabled": true,
"python.linting.lintOnSave": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length",
"160",
"--ignore=E203,W503,W504,E402"
 ],
//formatter
"python.formatting.provider": "none",
//static type checker
"python.linting.mypyEnabled": true,
  • 必要な拡張機能のインストール

問題なく機能するのか?

自分が使用しているものに焦点を当てる。

  • flake8
  • black
  • isort
  • mypy
    いずれも、機能することが確認できた。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0