Mosh + clang-tidy

伝説のプログラマポッドキャストJohn Carmack: Doom, Quake, VR, AGI, Programming, Video Games, and Rockets | Lex Fridman Podcast #309 - YouTubeを聴いていたらデバッガと static analyzer がいかに素晴らしいかを説いていたので clang-tidy を使ってみることにした。 Ubuntu 20.04 aarch64 上で

$ apt install bear clang-tidy
$ cd mosh.git
# clang-tidy が必要とする mosh.git/compile_commands.json を make コマンドの結果から生成
$ bear make
# とりあえずチェックする
$ run-clang-tidy -checks="-*,bugprone-macro-parentheses"
# 修正も実行
$ run-clang-tidy -checks="-*,bugprone-macro-parentheses" -fix