時々pycharmのインデントがおかしくなる時があるので調べてみた所
.editorconfigのファイルをいじると正常な設定に戻るみたいです

中身をこのように修正します

# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space

# ここから
indent_size = 4 
# ここまで

insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false

 

これでリフォーマットしたら治りました

 

参考記事

Tabs and Indents are 2 spaces despite setting at 4 spaces

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA