qnqn雑記

個人の学習ログの域は超えておりませんので間違っている可能性があり確かな情報を求められる場合は専門書等々に当たってください。体系的な情報については管理者ホームページへ(https://qnqn1927.github.io/)

vscode上でpythonのlinterを有効化

visual studio codepython linterを「flake8」に切り替えました!

f:id:qnqn1927:20210427034641p:plain

こんな感じでPEP8に則っているかどうか教えてくれます。便利。

どうするか?

code.visualstudio.com

Enable linters# To enable linters other than the default PyLint, open the Command Palette (⇧⌘P) and select the Python: Select Linter command. This command adds "python.linting.Enabled": true to your settings, where is the name of the chosen linter. See Specific linters for details.

コマンドパレットを開いて「Python: Select Linter」を選択することで、デフォルトのpylint以外のlinterを有効化できます。

flake8が入っているかは「pip list」で確認し、なければインストールしましょう。