.clang-tidy 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. ---
  5. # - bugprone-exception-escape finds issues like out-of-memory in main(). We
  6. # don't use exceptions, so it's unlikely to find real issues.
  7. # - google-readability-function-size overlaps with readability-function-size.
  8. # - modernize-use-nodiscard is disabled because it only fixes const methods,
  9. # not non-const, which yields distracting results on accessors.
  10. # - performance-unnecessary-value-param is disabled because it duplicate
  11. # modernize-pass-by-value.
  12. Checks:
  13. -*, bugprone-*, -bugprone-branch-clone, -bugprone-easily-swappable-parameters,
  14. -bugprone-exception-escape, -bugprone-narrowing-conversions, google-*,
  15. -google-readability-function-size, -google-readability-todo,
  16. misc-definitions-in-headers, misc-misplaced-const, misc-redundant-expression,
  17. misc-static-assert, misc-unconventional-assign-operator,
  18. misc-uniqueptr-reset-release, misc-unused-*, modernize-*,
  19. -modernize-avoid-c-arrays, -modernize-return-braced-init-list,
  20. -modernize-use-default-member-init, -modernize-use-emplace,
  21. -modernize-use-nodiscard, performance-*, -performance-unnecessary-value-param,
  22. readability-*, -readability-convert-member-functions-to-static,
  23. -readability-function-cognitive-complexity, -readability-else-after-return,
  24. -readability-identifier-length, -readability-implicit-bool-conversion,
  25. -readability-magic-numbers, -readability-make-member-function-const,
  26. -readability-static-definition-in-anonymous-namespace,
  27. -readability-suspicious-call-argument, -readability-use-anyofallof
  28. WarningsAsErrors: true
  29. CheckOptions:
  30. - { key: readability-identifier-naming.ClassCase, value: CamelCase }
  31. - { key: readability-identifier-naming.ClassConstantCase, value: CamelCase }
  32. - {
  33. key: readability-identifier-naming.ConstexprVariableCase,
  34. value: CamelCase,
  35. }
  36. - { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
  37. - { key: readability-identifier-naming.StructCase, value: CamelCase }
  38. - {
  39. key: readability-identifier-naming.TemplateParameterCase,
  40. value: CamelCase,
  41. }
  42. - { key: readability-identifier-naming.TypeAliasCase, value: CamelCase }
  43. - { key: readability-identifier-naming.TypedefCase, value: CamelCase }
  44. - { key: readability-identifier-naming.UnionCase, value: CamelCase }
  45. - { key: readability-identifier-naming.VariableCase, value: lower_case }
  46. - { key: readability-identifier-naming.ParameterCase, value: lower_case }
  47. - { key: readability-identifier-naming.ClassMemberCase, value: lower_case }
  48. - {
  49. key: readability-identifier-naming.MethodIgnoredRegexp,
  50. value: '^classof$',
  51. }