0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PlatformIOでmain.cpp以外のコーディングスタイルをArduino風にする方法

Posted at

結論

.editorconfigを設定しよう。

現象

VSCode上のPlatform.ioで、main.cppはインデントが2になるのに、
image.png

その他のファイルはインデントが4になってしまう。
image.png

よく見るとカッコ{}前の改行有無も違う。
Arudino風にフォーマット(コーディングスタイル)を統一したい。

解決方法

プロジェクトルートに.editorconfigファイルを配置する。
Arduino用の.editorconfigはこちらから入手できる。
arduino/tooling-project-assets/workflow-templates/assets/general
/.editorconfig

image.png

Shift-Alt-Fでオートフォーマットすると、ちゃんとインデントが2になる。

image.png

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?