Enable clang-tidy and apply fixes

Enable clang-tidy, fix the compile issue and fix the clang-tidy issues.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I6250c6519a725c07b0cd10abe464fda97a2aebd7
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..4b6eca0
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,7 @@
+Checks: '
+    -*,
+    bugprone-unchecked-optional-access,
+    readability-identifier-naming
+'
+WarningsAsErrors: '*'
+HeaderFilterRegex: '(?!^subprojects).*'