Skip to content

Commit

Permalink
CI: Update pre-commit hooks / clang-format-14
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Oct 15, 2024
1 parent cc7f9f0 commit b3b5ee6
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install clang-format-12
run: sudo apt-get install clang-format-12
- uses: pre-commit/action@v3.0.1
- name: Install clang-format-14
run: sudo apt-get install clang-format-14
- uses: rhaschke/pre-commit-action@main
id: precommit
- name: Upload pre-commit changes
if: failure() && steps.precommit.outcome == 'failure'
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -29,7 +29,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
args: ["--line-length", "100"]
Expand All @@ -39,7 +39,7 @@ repos:
- id: clang-format
name: clang-format
description: Format files with ClangFormat.
entry: clang-format-12
entry: clang-format-14
language: system
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
args: ["-fallback-style=none", "-i"]
10 changes: 7 additions & 3 deletions core/include/moveit/task_constructor/stage_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@
#include <chrono>

// define pimpl() functions accessing correctly casted pimpl_ pointer
#define PIMPL_FUNCTIONS(Class) \
const Class##Private* Class::pimpl() const { return static_cast<const Class##Private*>(pimpl_); } \
Class##Private* Class::pimpl() { return static_cast<Class##Private*>(pimpl_); }
#define PIMPL_FUNCTIONS(Class) \
const Class##Private* Class::pimpl() const { \
return static_cast<const Class##Private*>(pimpl_); \
} \
Class##Private* Class::pimpl() { \
return static_cast<Class##Private*>(pimpl_); \
}

namespace moveit {
namespace task_constructor {
Expand Down
4 changes: 2 additions & 2 deletions core/src/cost_terms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ double Clearance::operator()(const SubTrajectory& s, std::string& comment) const
auto& state_properties{ state->properties() };
auto& stage_properties{ s.creator()->properties() };
request.group_name = state_properties.hasProperty(group_property) ?
state_properties.get<std::string>(group_property) :
stage_properties.get<std::string>(group_property);
state_properties.get<std::string>(group_property) :
stage_properties.get<std::string>(group_property);

// look at all forbidden collisions involving group_name
request.enableGroup(state->scene()->getRobotModel());
Expand Down
2 changes: 1 addition & 1 deletion core/src/stages/compute_ik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void ComputeIK::compute() {
if (value.empty()) { // property undefined
// determine IK link from eef/group
if (!(link = eef_jmg ? robot_model->getLinkModel(eef_jmg->getEndEffectorParentGroup().second) :
jmg->getOnlyOneEndEffectorTip())) {
jmg->getOnlyOneEndEffectorTip())) {
RCLCPP_WARN_STREAM(LOGGER, "Failed to derive IK target link");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/stages/modify_planning_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void ModifyPlanningScene::attachObjects(planning_scene::PlanningScene& scene,
if (invert)
attach = !attach;
obj.object.operation = attach ? static_cast<int8_t>(moveit_msgs::msg::CollisionObject::ADD) :
static_cast<int8_t>(moveit_msgs::msg::CollisionObject::REMOVE);
static_cast<int8_t>(moveit_msgs::msg::CollisionObject::REMOVE);
for (const std::string& name : pair.second.first) {
obj.object.id = name;
scene.processAttachedCollisionObjectMsg(obj);
Expand Down
2 changes: 1 addition & 1 deletion core/src/stages/simple_grasp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void SimpleGraspBase::setup(std::unique_ptr<Stage>&& generator, bool forward) {
const std::string& eef = p.get<std::string>("eef");
moveit_msgs::msg::AttachedCollisionObject obj;
obj.object.operation = forward ? static_cast<int8_t>(moveit_msgs::msg::CollisionObject::ADD) :
static_cast<int8_t>(moveit_msgs::msg::CollisionObject::REMOVE);
static_cast<int8_t>(moveit_msgs::msg::CollisionObject::REMOVE);
obj.link_name = scene->getRobotModel()->getEndEffector(eef)->getEndEffectorParentGroup().second;
obj.object.id = p.get<std::string>("object");
scene->processAttachedCollisionObjectMsg(obj);
Expand Down
2 changes: 1 addition & 1 deletion core/test/test_stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void attachObject(PlanningScene& scene, const std::string& object, const std::st
moveit_msgs::msg::AttachedCollisionObject obj;
obj.link_name = link;
obj.object.operation = attach ? static_cast<int8_t>(moveit_msgs::msg::CollisionObject::ADD) :
static_cast<int8_t>(moveit_msgs::msg::CollisionObject::REMOVE);
static_cast<int8_t>(moveit_msgs::msg::CollisionObject::REMOVE);
obj.object.id = object;
scene.processAttachedCollisionObjectMsg(obj);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ScopedYamlEvent
{
public:
~ScopedYamlEvent() { yaml_event_delete(&event_); }
operator yaml_event_t const &() const { return event_; }
operator yaml_event_t const&() const { return event_; }
operator yaml_event_t&() { return event_; }

private:
Expand Down

0 comments on commit b3b5ee6

Please sign in to comment.