Skip to content

Commit

Permalink
Trajopt clang-tidy clean-up v3 (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjoomen authored Jul 16, 2024
1 parent 4a908dd commit efd9b8d
Show file tree
Hide file tree
Showing 97 changed files with 1,237 additions and 1,202 deletions.
76 changes: 37 additions & 39 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,78 +1,76 @@
---
Checks: >
-*,
clang-diagnostic-*,
-clang-diagnostic-unknown-warning-option,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
misc-*,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
performance-*,
readability-*,
-readability-avoid-unconditional-preprocessor-if,
-readability-braces-around-statements,
-readability-named-parameter,
-readability-magic-numbers,
-readability-isolate-declaration,
-readability-function-cognitive-complexity,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-suspicious-call-argument
-readability-magic-numbers,
-readability-named-parameter,
-readability-suspicious-call-argument,
WarningsAsErrors: >
-*,
clang-diagnostic-*,
-clang-diagnostic-unknown-warning-option,
clang-analyzer-*,
-clang-analyzer-cplusplus*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
clang-analyzer-*,
-clang-analyzer-core.uninitialized.UndefReturn,
-clang-analyzer-cplusplus*,
-clang-analyzer-optin.core.EnumCastOutOfRange,
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
misc-*,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
performance-*,
readability-*,
-readability-avoid-unconditional-preprocessor-if,
-readability-braces-around-statements,
-readability-named-parameter,
-readability-magic-numbers,
-readability-isolate-declaration,
-readability-function-cognitive-complexity
-readability-use-anyofallof,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-suspicious-call-argument
-readability-magic-numbers,
-readability-named-parameter,
-readability-suspicious-call-argument,
HeaderFilterRegex: '.*'
FormatStyle: none
CheckOptions:
Expand Down
8 changes: 4 additions & 4 deletions trajopt/include/trajopt/problem_description.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ enum class TermType : char

inline TermType operator|(TermType lhs, TermType rhs)
{
using T = std::underlying_type<TermType>::type;
using T = std::underlying_type_t<TermType>;
return TermType(static_cast<T>(lhs) | static_cast<T>(rhs));
}

inline TermType operator&(TermType lhs, TermType rhs)
{
using T = std::underlying_type<TermType>::type;
using T = std::underlying_type_t<TermType>;
return TermType(static_cast<T>(lhs) & static_cast<T>(rhs));
}

inline TermType operator^(TermType lhs, TermType rhs)
{
using T = std::underlying_type<TermType>::type;
using T = std::underlying_type_t<TermType>;
return TermType(static_cast<T>(lhs) ^ static_cast<T>(rhs));
}

inline TermType operator~(TermType rhs)
{
using T = std::underlying_type<TermType>::type;
using T = std::underlying_type_t<TermType>;
return TermType(~static_cast<T>(rhs));
}

Expand Down
4 changes: 2 additions & 2 deletions trajopt/include/trajopt/typedefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class TrajOptCostFromErrFunc : public sco::CostFromErrFunc, public Plotter
// If error function has a inherited from TrajOptVectorOfVector, call its Plot function
if (auto* plt = dynamic_cast<TrajOptVectorOfVector*>(f_.get()))
{
Eigen::VectorXd dof_vals = sco::getVec(x, vars_);
const Eigen::VectorXd dof_vals = sco::getVec(x, vars_);
plt->Plot(plotter, dof_vals);
}
}
Expand Down Expand Up @@ -120,7 +120,7 @@ class TrajOptConstraintFromErrFunc : public sco::ConstraintFromErrFunc, public P
// If error function has a inherited from TrajOptVectorOfVector, call its Plot function
if (auto* plt = dynamic_cast<TrajOptVectorOfVector*>(f_.get()))
{
Eigen::VectorXd dof_vals = sco::getVec(x, vars_);
const Eigen::VectorXd dof_vals = sco::getVec(x, vars_);
plt->Plot(plotter, dof_vals);
}
}
Expand Down
Loading

0 comments on commit efd9b8d

Please sign in to comment.