mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-09-27 00:29:13 +08:00
Perform clang-format check via github action from pre-commit.com
This commit is contained in:
parent
0b63c590c5
commit
5de9ce7203
20
.github/workflows/format.yml
vendored
Normal file
20
.github/workflows/format.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# This is a format job. Pre-commit has a first-party GitHub action, so we use
|
||||
# that: https://github.com/pre-commit/action
|
||||
|
||||
name: Format
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
name: Format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- name: Install clang-format-10
|
||||
run: sudo apt-get install clang-format-10
|
||||
- uses: pre-commit/action@v2.0.0
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1 @@
|
||||
*.swp
|
||||
|
||||
|
47
.pre-commit-config.yaml
Normal file
47
.pre-commit-config.yaml
Normal file
@ -0,0 +1,47 @@
|
||||
# To use:
|
||||
#
|
||||
# pre-commit run -a
|
||||
#
|
||||
# Or:
|
||||
#
|
||||
# pre-commit install # (runs every time you commit in git)
|
||||
#
|
||||
# To update this file:
|
||||
#
|
||||
# pre-commit autoupdate
|
||||
#
|
||||
# See https://github.com/pre-commit/pre-commit
|
||||
|
||||
repos:
|
||||
# Standard hooks
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v3.4.0
|
||||
hooks:
|
||||
- id: check-added-large-files
|
||||
- id: check-case-conflict
|
||||
- id: check-merge-conflict
|
||||
- id: check-symlinks
|
||||
- id: check-xml
|
||||
- id: check-yaml
|
||||
- id: debug-statements
|
||||
- id: end-of-file-fixer
|
||||
- id: mixed-line-ending
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: clang-format
|
||||
name: clang-format
|
||||
description: Format files with ClangFormat.
|
||||
entry: clang-format-10
|
||||
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']
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: misspelled-moveit
|
||||
name: misspelled-moveit
|
||||
description: MoveIt should be spelled exactly as MoveIt
|
||||
language: pygrep
|
||||
entry: Moveit|MoveIt!
|
||||
exclude: .pre-commit-config.yaml|README.md
|
@ -16,7 +16,6 @@ env:
|
||||
- UPSTREAM_WORKSPACE=.rosinstall
|
||||
|
||||
jobs:
|
||||
- env: TEST=clang-format
|
||||
- env: TEST=code-coverage
|
||||
- compiler: clang
|
||||
env: DOCKER_IMAGE=moveit/moveit:master-source
|
||||
|
@ -277,7 +277,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())) {
|
||||
ROS_WARN_STREAM_NAMED("ComputeIK", "Failed to derive IK target link");
|
||||
return;
|
||||
}
|
||||
|
@ -62,4 +62,4 @@ TEST(Interface, update) {
|
||||
|
||||
i.updatePriority(*i.begin(), Prio(6, std::numeric_limits<double>::infinity()));
|
||||
EXPECT_THAT(i.depths(), ::testing::ElementsAreArray({ 5, 3 })); // larger priority is ignored
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,4 @@
|
||||
<depend>moveit_core</depend>
|
||||
<depend>rosparam_shortcuts</depend>
|
||||
<exec_depend>moveit_resources_panda_moveit_config</exec_depend>
|
||||
</package>
|
||||
</package>
|
||||
|
Loading…
Reference in New Issue
Block a user