aaron.ballman added inline comments.

================
Comment at: clang-tidy/bugprone/HeaderGuardCheck.cpp:50
+
+  } else {
+    if (OldGuard.size())
----------------
I think this should be an `else if` rather than an `else`. I'd like to see us 
diagnose unknown guard styles so that we only accept "llvm" and "" as guard 
styles; this makes it easier to add new guard styles in the future.


================
Comment at: docs/clang-tidy/checks/bugprone-header-guard.rst:11
+
+.. option:: HeaderFileExtensions
+
----------------
Should we be documenting the `GuardStyle` option here as well? We could 
document "llvm" as the only available option currently and mention the 
llvm-header-guard check as an alias which enables this style.


================
Comment at: test/clang-tidy/bugprone-header-guard.cpp:1-3
+// RUN: %check_clang_tidy %s bugprone-header-guard %t -- \
+// RUN:   -config="{CheckOptions: [{key: 
bugprone-header-guard.HeaderFileExtensions, value: 'cpp'}]}" \
+// RUN:   -header-filter=.* --
----------------
Can you add a test for the `GuardStyle` option? Both when specifying `llvm` and 
some random unsupported string.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61508/new/

https://reviews.llvm.org/D61508



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to