結論
.editorconfig
を設定しよう。
現象
VSCode上のPlatform.ioで、main.cppはインデントが2になるのに、
よく見るとカッコ{}
前の改行有無も違う。
Arudino風にフォーマット(コーディングスタイル)を統一したい。
解決方法
プロジェクトルートに.editorconfig
ファイルを配置する。
Arduino用の.editorconfig
はこちらから入手できる。
arduino/tooling-project-assets/workflow-templates/assets/general
/.editorconfig
Shift-Alt-F
でオートフォーマットすると、ちゃんとインデントが2になる。