1. 07 Apr, 2020 1 commit
  2. 06 Apr, 2020 4 commits
  3. 04 Apr, 2020 3 commits
  4. 01 Apr, 2020 1 commit
  5. 31 Mar, 2020 1 commit
  6. 25 Mar, 2020 1 commit
  7. 24 Mar, 2020 5 commits
  8. 20 Mar, 2020 1 commit
  9. 18 Mar, 2020 1 commit
  10. 04 Mar, 2020 1 commit
  11. 03 Mar, 2020 7 commits
    • Hans Johnson's avatar
      STYLE: Use range-based loops from C++11 · 6621b069
      Hans Johnson authored
      C++11 Range based for loops can be used in
      
      Used as a more readable equivalent to the traditional for loop operating over a
      range of values, such as all elements in a container, in the forward direction..
      
      Range based loopes are more explicit for only computing the
      end location once for containers.
      6621b069
    • Hans Johnson's avatar
      STYLE: Use auto for variable type matches the type of the initializer · cc8fc323
      Hans Johnson authored
      This check is responsible for using the auto type specifier for variable
      declarations to improve code readability and maintainability.
      
      The auto type specifier will only be introduced in situations where the
      variable type matches the type of the initializer expression. In other words
      auto should deduce the same type that was originally spelled in the source
      cc8fc323
    • Hans Johnson's avatar
      PERF: emplace_back method results in potentially more efficient code · 91429382
      Hans Johnson authored
      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.
      91429382
    • Hans Johnson's avatar
      STYLE: Prefer = default to explicitly trivial implementations · 6d20e7c9
      Hans Johnson authored
      This check replaces default bodies of special member functions with
      = default;. The explicitly defaulted function declarations enable more
      opportunities in optimization, because the compiler might treat
      explicitly defaulted functions as trivial.
      
      Additionally, the C++11 use of = default more clearly expreses the
      intent for the special member functions.
      6d20e7c9
    • Hans Johnson's avatar
      STYLE: Use default member initialization · d07092a0
      Hans Johnson authored
      Converts a default constructor’s member initializers into the new
      default member initializers in C++11. Other member initializers that match the
      default member initializer are removed. This can reduce repeated code or allow
      use of ‘= default’.
      d07092a0
    • Hans Johnson's avatar
      COMP: Prefer const member functions · 4c7f64eb
      Hans Johnson authored
      Finds non-static member functions that can be made const because the functions
      don’t use this in a non-const way.
      
      This check tries to annotate methods according to logical constness (not
      physical constness). Therefore, it will suggest to add a const qualifier to a
      non-const method only if this method does something that is already possible
      though the public interface on a const pointer to the object:
      
      reading a public member variable calling a public const-qualified member
      function returning const-qualified this passing const-qualified this as a
      parameter.  This check will also suggest to add a const qualifier to a
      non-const method if this method uses private data and functions in a limited
      number of ways where logical constness and physical constness coincide:
       - reading a member variable of builtin type
      Specifically, this check will not suggest to add a const to a non-const
      method if the method reads a private member variable of pointer type because
      that allows to modify the pointee which might not preserve logical constness.
      For the same reason, it does not allow to call private member functions or
      member functions on private member variables.
      
      In addition, this check ignores functions that
       - are declared virtual
       - contain a const_cast
       - are templated or part of a class template
       - have an empty body
       - do not (implicitly) use this at all (see readability-convert-member-functions-to-static).
      4c7f64eb
    • Hans Johnson's avatar
      COMP: Prefer const pointer when value does not change · acc916ed
      Hans Johnson authored
      The check finds function parameters of a pointer type that could be changed to
      point to a constant type instead.
      
      When const is used properly, many mistakes can be avoided. Advantages when
      using const properly:
       - prevent unintentional modification of data;
       - get additional warnings such as using uninitialized data;
       - make it easier for developers to see possible side effects.
      
      This check is not strict about constness, it only warns when the constness will
      make the function interface safer.
      acc916ed
  12. 02 Mar, 2020 11 commits
    • Hans Johnson's avatar
      STYLE: Prefer c++11 'using' to 'typedef' · 7be4043f
      Hans Johnson authored
      The check converts the usage of typedef with using keyword.
      
      cd ${BLDDIR}
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-using  -header-filter=.* -fix
      # https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html
      7be4043f
    • Hans Johnson's avatar
      PERF: readability container size empty · 691d5612
      Hans Johnson authored
      The emptiness of a container should be checked using the empty() method
      instead of the size() method. It is not guaranteed that size() is a
      constant-time function, and it is generally more efficient and also
      shows clearer intent to use empty(). Furthermore some containers may
      implement the empty() method but not implement the size() method. Using
      empty() whenever possible makes it easier to switch to another container
      in the future.
      
      cd
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,readability-container-size-empty  -header-filter=.* -fix
      691d5612
    • Hans Johnson's avatar
      STYLE: Make prototype match definition names · 3b30d0ff
      Hans Johnson authored
      Enforce consistency in large projects, where it often happens that a definition
      of function is refactored, changing the parameter names, but its declaration in
      header file is not updated. With this check, we can easily find and correct
      such inconsistencies, keeping declaration and definition always in sync.
      
      Unnamed parameters are allowed and are not taken into account when comparing
      function declarations
      3b30d0ff
    • Hans Johnson's avatar
      STYLE: Make prototype match definition names · 0fe7214d
      Hans Johnson authored
      Enforce consistency in large projects, where it often happens that a definition
      of function is refactored, changing the parameter names, but its declaration in
      header file is not updated. With this check, we can easily find and correct
      such inconsistencies, keeping declaration and definition always in sync.
      
      Unnamed parameters are allowed and are not taken into account when comparing
      function declarations
      0fe7214d
    • Hans Johnson's avatar
      STYLE: Replace integer literals which are cast to bool. · 2a4c1252
      Hans Johnson authored
      Finds and replaces integer literals which are cast to bool.
      
      cd ${BLDDIR}
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-bool-literals  -header-filter=.* -fix
      2a4c1252
    • Hans Johnson's avatar
      COMP: Use nullptr instead of 0 or NULL · 1c3e193d
      Hans Johnson authored
      The check converts the usage of null pointer constants (eg. NULL, 0) to
      use the new C++11 nullptr keyword.
      
      cd
      run-clang-tidy.py -extra-arg=-D__clang__ -checks=-*,modernize-use-nullptr  -header-filter=.* -fix
      1c3e193d
    • Hans Johnson's avatar
      STYLE: Remove redundant void argument lists · 8a7fe7ac
      Hans Johnson authored
      Find and remove redundant void argument lists.
      8a7fe7ac
    • Hans Johnson's avatar
      6ce3d69a
    • Hans Johnson's avatar
      STYLE: Convert CMake-language commands to lower case · 28b8e6c2
      Hans Johnson authored
      Ancient CMake versions required upper-case commands.  Later command names
      became case-insensitive.  Now the preferred style is lower-case.
      28b8e6c2
    • Hans Johnson's avatar
      STYLE: Use modern path naming · 81d1e737
      Hans Johnson authored
      EXECUTABLE_OUTPUT_PATH is the old executable location variable.
      
      The target property RUNTIME_OUTPUT_DIRECTORY supercedes this variable
      for a target if it is set. Executable targets are otherwise placed in
      this directory.
      81d1e737
    • Brad King's avatar
      Merge topic 'mingw-psapi' · 0e34fbcf
      Brad King authored and Kitware Robot's avatar Kitware Robot committed
      a1a261ac
      
       CMake: Fix psapi lib name on case-sensitive fs
      Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
      Merge-request: !170
      0e34fbcf
  13. 28 Feb, 2020 1 commit
  14. 25 Feb, 2020 2 commits