Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trajopt clang-tidy clean-up v3 #414

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading