.clang-tidy 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. ---
  2. # TODO(crbug.com/1282228): reenable google-readability-casting once it no
  3. # longer has as many false-positives.
  4. Checks: '-*,
  5. bugprone-argument-comment,
  6. bugprone-assert-side-effect,
  7. bugprone-bool-pointer-implicit-conversion,
  8. bugprone-dangling-handle,
  9. bugprone-forward-declaration-namespace,
  10. bugprone-inaccurate-erase,
  11. bugprone-string-constructor,
  12. bugprone-string-integer-assignment,
  13. bugprone-undefined-memory-manipulation,
  14. bugprone-unique-ptr-array-mismatch,
  15. bugprone-unused-raii,
  16. bugprone-use-after-move,
  17. bugprone-virtual-near-miss,
  18. google-build-explicit-make-pair,
  19. google-default-arguments,
  20. google-explicit-constructor,
  21. google-objc-avoid-nsobject-new,
  22. google-upgrade-googletest-case,
  23. misc-misleading-identifier,
  24. misc-homoglyph,
  25. modernize-avoid-bind,
  26. modernize-concat-nested-namespaces,
  27. modernize-loop-convert,
  28. modernize-make-shared,
  29. modernize-make-unique,
  30. modernize-redundant-void-arg,
  31. modernize-replace-random-shuffle,
  32. modernize-shrink-to-fit,
  33. modernize-use-bool-literals,
  34. modernize-use-default-member-init,
  35. modernize-use-emplace,
  36. modernize-use-equals-default,
  37. modernize-use-equals-delete,
  38. modernize-use-noexcept,
  39. modernize-use-nullptr,
  40. modernize-use-override,
  41. modernize-use-transparent-functors,
  42. readability-redundant-member-init'
  43. CheckOptions:
  44. - key: bugprone-assert-side-effect.AssertMacros
  45. value: assert,DCHECK
  46. - key: bugprone-dangling-handle.HandleClasses
  47. value: ::std::basic_string_view;::std::span;::absl::string_view;::base::BasicStringPiece;::base::span
  48. - key: bugprone-string-constructor.StringNames
  49. value: ::std::basic_string;::std::basic_string_view;::base::BasicStringPiece;::absl::string_view
  50. - key: modernize-use-default-member-init.UseAssignment
  51. value: 1
  52. # crbug.com/1342136, crbug.com/1343915: At times, this check makes
  53. # suggestions that break builds. Safe mode allows us to sidestep that.
  54. - key: modernize-use-transparent-functors.SafeMode
  55. value: 1
  56. # This relaxes modernize-use-emplace in some cases; we might want to make it
  57. # more aggressive in the future. See discussion on
  58. # https://groups.google.com/a/chromium.org/g/cxx/c/noMMTNYiM0w .
  59. - key: modernize-use-emplace.IgnoreImplicitConstructors
  60. value: 1
  61. # Use of `std::ranges::reverse_view` is inconsistent with
  62. # Chromium style. Recommend `base::Reversed` instead.
  63. - key: modernize-loop-convert.MakeReverseRangeFunction
  64. value: base::Reversed
  65. - key: modernize-loop-convert.MakeReverseRangeHeader
  66. value: base/containers/adapters.h
  67. # Exclude some third_party headers from modification as file paths are not
  68. # starting from repository root in replacement suggestion.
  69. # 'build/linux/debian' excludes system headers as they don't have
  70. # appropriate IWYU pragmas.
  71. # https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html
  72. - key: misc-include-cleaner.IgnoreHeaders
  73. value: (gmock/gmock|gtest/gtest|third_party|build/linux/debian).*
  74. ExtraArgs:
  75. # b/382774818: disable unknown pragma warnings until we can figure out why
  76. # unknown pragmas are being warned about.
  77. - -Wno-unknown-pragmas
  78. ...