# clang-tidy configuration for peclet.voro
# https://clang.llvm.org/extra/clang-tidy/
#
# Enable a curated set of checks aligned with the Google C++ Style Guide and
# modern C++ best practices.  A few checks are disabled because the current
# code base uses patterns (e.g. VLAs as GCC extensions, raw owning pointers in
# legacy geometry code) that would generate too much noise before the code is
# further modernised.

Checks: >
  clang-diagnostic-*,
  clang-analyzer-*,
  cppcoreguidelines-avoid-goto,
  cppcoreguidelines-init-variables,
  cppcoreguidelines-narrowing-conversions,
  cppcoreguidelines-no-malloc,
  google-build-explicit-make-pair,
  google-build-namespaces,
  google-explicit-constructor,
  google-global-names-in-headers,
  google-readability-avoid-underscore-in-googletest-name,
  google-readability-casting,
  google-readability-todo,
  google-runtime-int,
  google-runtime-operator,
  modernize-avoid-bind,
  modernize-loop-convert,
  modernize-make-shared,
  modernize-make-unique,
  modernize-pass-by-value,
  modernize-redundant-void-arg,
  modernize-replace-auto-ptr,
  modernize-shrink-to-fit,
  modernize-use-bool-literals,
  modernize-use-default-member-init,
  modernize-use-emplace,
  modernize-use-equals-default,
  modernize-use-equals-delete,
  modernize-use-nodiscard,
  modernize-use-nullptr,
  modernize-use-override,
  modernize-use-using,
  performance-faster-string-find,
  performance-for-range-copy,
  performance-implicit-conversion-in-loop,
  performance-inefficient-algorithm,
  performance-inefficient-string-concatenation,
  performance-inefficient-vector-operation,
  performance-move-const-arg,
  performance-move-constructor-init,
  performance-no-automatic-move,
  performance-trivially-destructible,
  performance-type-promotion-in-math-fn,
  performance-unnecessary-copy-initialization,
  performance-unnecessary-value-param,
  readability-braces-around-statements,
  readability-const-return-type,
  readability-container-size-empty,
  readability-delete-null-pointer,
  readability-else-after-return,
  readability-function-size,
  readability-identifier-naming,
  readability-implicit-bool-conversion,
  readability-misleading-indentation,
  readability-misplaced-array-index,
  readability-non-const-parameter,
  readability-redundant-access-specifiers,
  readability-redundant-control-flow,
  readability-redundant-declaration,
  readability-redundant-member-init,
  readability-redundant-preprocessor,
  readability-redundant-smartptr-get,
  readability-redundant-string-cstr,
  readability-redundant-string-init,
  readability-simplify-subscript-expr,
  readability-static-accessed-through-instance,
  readability-static-definition-in-anonymous-namespace,
  readability-string-compare,
  readability-uniqueptr-delete-release,
  -cppcoreguidelines-pro-bounds-array-to-pointer-decay,
  -cppcoreguidelines-pro-bounds-constant-array-index,
  -cppcoreguidelines-pro-bounds-pointer-arithmetic,
  -cppcoreguidelines-pro-type-reinterpret-cast,
  -cppcoreguidelines-pro-type-vararg,
  -google-runtime-references,
  -readability-magic-numbers

WarningsAsErrors: ''

HeaderFilterRegex: 'include/peclet/voro/.*'

FormatStyle: file

CheckOptions:
  - key: readability-identifier-naming.NamespaceCase
    value: lower_case
  - key: readability-identifier-naming.ClassCase
    value: CamelCase
  - key: readability-identifier-naming.StructCase
    value: CamelCase
  - key: readability-identifier-naming.TemplateParameterCase
    value: CamelCase
  - key: readability-identifier-naming.FunctionCase
    value: camelBack
  - key: readability-identifier-naming.VariableCase
    value: camelBack
  - key: readability-identifier-naming.ClassMemberCase
    value: camelBack
  - key: readability-identifier-naming.ClassMemberPrefix
    value: 'm_'
  - key: readability-identifier-naming.PrivateMemberPrefix
    value: 'm_'
  - key: readability-identifier-naming.ConstantCase
    value: kCamelCase
  - key: readability-identifier-naming.EnumConstantCase
    value: kCamelCase
  - key: readability-function-size.LineThreshold
    value: '200'
  - key: readability-function-size.StatementThreshold
    value: '100'
