1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vscodeでyapfが効かなかった話

1
Posted at

症状

vscodeでautopep8やblackは効くのにyapfだけ効かない

結論

~/.config/yapf/styleが空ファイルだった。

適当に書く

~/.config/yapf/style
[style]
based_on_style = pep8
spaces_before_comment = 4

確認

vscodeでctrl+shift+pでコマンドパレットを開きShow logs > window > pythonを確認
> ~/.local/bin/yapf --diff ~/test.pyみたいになっているので端末で同じのを試す。

$ yapf --diff ~/test.py
// yapf: Unable to find section [style] in ~/.config/yapf/style

[style]がないのがエラーの原因なので書き足せば動く

1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?