Skip to content

HLTSeeding: spell-check, consistent indentation, clang-tidy, general cleanup

Rafal Bielski requested to merge rbielski/athena:hltseeding-tidy into master

Code quality improvements in the HLTSeeding package.

Included:

  • fix typos
  • fix doxygen documentation formatting
  • fix inconsistent indentation (style and mix of tabs and spaces)
  • try to ensure a bit more consistent formatting within each file and to some extent also between files
  • try to improve readability (e.g. split lines >100 characters, remove excessive newlines and add some where useful)
  • remove trailing whitespace
  • remove unused code and obsolete comments
  • fix a number of potential issues reported by clang-tidy (a separate commit)

The following clang-tidy warnings are fixed:

  • warning: statement should be inside braces [readability-braces-around-statements]
  • warning: the 'empty' method should be used to check for emptiness [readability-container-size-empty]
  • warning: narrowing conversion from 'unsigned long' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
  • warning: do not use 'else' after 'return' [readability-else-after-return]
  • warning: ... is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers]
  • warning: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr]
  • warning: statement should be inside braces [readability-braces-around-statements]
  • warning: implicit conversion ... -> bool / bool -> ... [readability-implicit-bool-conversion]
  • warning: method ... can be made static [readability-convert-member-functions-to-static]
  • warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [performance-faster-string-find]
  • warning: argument name ... in comment does not match parameter name ... [bugprone-argument-comment]
  • warning: initializing non-owner argument of type ... with a newly created 'gsl::owner<>' [cppcoreguidelines-owning-memory] (in other words: don't use new)
  • warning: redundant void argument list in lambda expression [modernize-redundant-void-arg]
  • warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
  • warning: constructor does not initialize these fields: ... [cppcoreguidelines-pro-type-member-init]
  • warning: use emplace_back instead of push_back [modernize-use-emplace]
  • warning: the parameter ... is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
  • warning: macro ... used to declare a constant [cppcoreguidelines-macro-usage]

Merge request reports