Skip to content

Commit

Permalink
Enable addition code checks
Browse files Browse the repository at this point in the history
performance-faster-string-find:
  Optimize calls to std::string::find() and friends when the needle passed is
  a single character string literal.

performance-for-range-copy:
  Finds C++11 for ranges where the loop variable is copied in each iteration
  but it would suffice to obtain it by const reference.

performance-implicit-conversion-in-loop:
  This warning appears in a range-based loop with a loop variable of const ref
  type where the type of the variable does not match the one returned by the
  iterator. This means that an implicit conversion happens, which can for
  example result in expensive deep copies.

performance-inefficient-algorithm:
  Warns on inefficient use of STL algorithms on associative containers.

performance-inefficient-vector-operation:
  Finds possible inefficient std::vector operations (e.g. push_back, emplace_back)
  that may cause unnecessary memory reallocations.

performance-move-const-arg:
  Warn about inefficient use of std::move, and suggest a fix that removes it.

performance-unnecessary-copy-initialization:
  Finds local variable declarations that are initialized using the copy
  constructor of a non-trivially-copyable type, where it would suffice to
  obtain a const reference.

performance-unnecessary-value-param:
  Flags value parameter declarations of expensive to copy types that are copied
  for each invocation, where it would suffice to pass them by const reference.

modernize-make-unique:
  Finds the creation of std::unique_ptr objects explicitly calling a new
  expression, and replaces it with a call to std::make_unique.

modernize-loop-convert:
  This check converts for(...; ...; ...) loops to use the new range-based loops
  in C++11.
  The MinConfidence option was already set to "reasonable".

modernize-use-auto:
  Use the auto type specifier for variable declarations to improve code
  readability and maintainability.
  The MinTypeNameLength option is set to 16 characters.

modernize-use-emplace:
  The check flags insertions to an STL-style container done by calling the
  push_back method with an explicitly-constructed temporary of the container
  element type. In this case, the corresponding emplace_back method results
  in less verbose and potentially more efficient code.
  • Loading branch information
fwyzard committed May 16, 2020
1 parent 8c0e2bf commit 0183239
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@ Checks: -*,
,misc-string-compare,
,misc-uniqueptr-reset-release,
,modernize-deprecated-headers,
,performance-faster-string-find,
,performance-implicit-conversion-in-loop,
,performance-inefficient-algorithm,
,performance-inefficient-vector-operation,
,performance-move-const-arg,
,performance-unnecessary-copy-initialization,
,performance-unnecessary-value-param,
,modernize-make-shared,
,modernize-make-unique,
,modernize-loop-convert,
,modernize-use-auto,
,modernize-use-bool-literals,
,modernize-use-equals-delete,
,modernize-use-emplace,
,modernize-use-nullptr,
,modernize-use-override,
,performance-unnecessary-copy-initialization,
Expand Down Expand Up @@ -36,6 +47,8 @@ CheckOptions:
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-auto.MinTypeNameLength
value: 16
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
...
Expand Down

0 comments on commit 0183239

Please sign in to comment.