Skip to content

Commit

Permalink
Fix clang-tidy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Jun 30, 2023
1 parent 2fadc03 commit 08f1bfe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/focal_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"
TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON -DTRAJOPT_ENABLE_CLANG_TIDY=ON"
AFTER_SCRIPT: 'catkin build -w $target_ws --no-deps --verbose trajopt trajopt_ifopt trajopt_sco trajopt_sqp --make-args test'
ADDITIONAL_DEBS: clang-tidy
ADDITIONAL_DEBS: clang-tidy-12
steps:
- uses: actions/checkout@v1

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unstable_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"
TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug -DTRAJOPT_ENABLE_TESTING=ON -DTRAJOPT_ENABLE_CLANG_TIDY=ON"
AFTER_SCRIPT: 'catkin build -w $target_ws --no-deps --verbose trajopt trajopt_ifopt trajopt_sco trajopt_sqp --make-args test'
ADDITIONAL_DEBS: clang-tidy
ADDITIONAL_DEBS: clang-tidy-12
steps:
- uses: actions/checkout@v1

Expand Down
6 changes: 3 additions & 3 deletions trajopt_sco/include/trajopt_sco/solver_interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ struct VarRep
using Ptr = std::shared_ptr<VarRep>;

VarRep(std::size_t _index, std::string _name, void* _creator)
: index(_index), name(std::move(_name)), removed(false), creator(_creator)
: index(_index), name(std::move(_name)), creator(_creator)
{
}
std::size_t index;
std::string name;
bool removed;
bool removed{ false };
void* creator;
};

Expand Down Expand Up @@ -249,7 +249,7 @@ class ModelType
friend std::ostream& operator<<(std::ostream& os, const ModelType& cs);

private:
Value value_;
Value value_{ Value::AUTO_SOLVER };
};

std::vector<ModelType> availableSolvers();
Expand Down
8 changes: 4 additions & 4 deletions trajopt_sco/src/solver_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ std::ostream& operator<<(std::ostream& os, const ModelType& cs)
return os;
}

ModelType::ModelType() { value_ = ModelType::AUTO_SOLVER; }
ModelType::ModelType(const ModelType::Value& v) { value_ = v; }
ModelType::ModelType(const int& v) { value_ = static_cast<Value>(v); }
ModelType::ModelType() = default;
ModelType::ModelType(const ModelType::Value& v) : value_(v) {}
ModelType::ModelType(const int& v) : value_(static_cast<Value>(v)) {}
ModelType::ModelType(const std::string& s)
{
for (unsigned int i = 0; i < ModelType::MODEL_NAMES_.size(); ++i)
Expand Down Expand Up @@ -351,6 +351,6 @@ Model::Ptr createModel(ModelType model_type, const ModelConfig::ConstPtr& model_
std::stringstream solver_instatiation_error;
solver_instatiation_error << "Failed to create solver: unknown solver " << solver << std::endl;
PRINT_AND_THROW(solver_instatiation_error.str());
return Model::Ptr();
return {};
}
} // namespace sco
2 changes: 1 addition & 1 deletion trajopt_sco/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ target_compile_options(${PROJECT_NAME}-test PRIVATE ${TRAJOPT_COMPILE_OPTIONS_PR
target_compile_definitions(${PROJECT_NAME}-test PRIVATE ${TRAJOPT_COMPILE_DEFINITIONS}
TRAJOPT_IFOPT_DIR="${CMAKE_SOURCE_DIR}")
target_cxx_version(${PROJECT_NAME}-test PRIVATE VERSION ${TRAJOPT_CXX_VERSION})
# target_clang_tidy(${PROJECT_NAME}-test ENABLE ${TRAJOPT_ENABLE_CLANG_TIDY})
target_clang_tidy(${PROJECT_NAME}-test ENABLE ${TRAJOPT_ENABLE_CLANG_TIDY})
add_gtest_discover_tests(${PROJECT_NAME}-test)
if(HAVE_BPMPD)
add_dependencies(${PROJECT_NAME}-test bpmpd_caller)
Expand Down

0 comments on commit 08f1bfe

Please sign in to comment.