Skip to content

Commit 5de9ce7

Browse files
committed
Perform clang-format check via github action from pre-commit.com
1 parent 0b63c59 commit 5de9ce7

File tree

7 files changed

+70
-5
lines changed

7 files changed

+70
-5
lines changed

.github/workflows/format.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This is a format job. Pre-commit has a first-party GitHub action, so we use
2+
# that: https://github.com/pre-commit/action
3+
4+
name: Format
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
push:
10+
11+
jobs:
12+
pre-commit:
13+
name: Format
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-python@v2
18+
- name: Install clang-format-10
19+
run: sudo apt-get install clang-format-10
20+
- uses: pre-commit/[email protected]

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
*.swp
2-

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
14+
15+
repos:
16+
# Standard hooks
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v3.4.0
19+
hooks:
20+
- id: check-added-large-files
21+
- id: check-case-conflict
22+
- id: check-merge-conflict
23+
- id: check-symlinks
24+
- id: check-xml
25+
- id: check-yaml
26+
- id: debug-statements
27+
- id: end-of-file-fixer
28+
- id: mixed-line-ending
29+
30+
- repo: local
31+
hooks:
32+
- id: clang-format
33+
name: clang-format
34+
description: Format files with ClangFormat.
35+
entry: clang-format-10
36+
language: system
37+
files: \.(c|cc|cxx|cpp|frag|glsl|h|hpp|hxx|ih|ispc|ipp|java|js|m|proto|vert)$
38+
args: ['-fallback-style=none', '-i']
39+
40+
- repo: local
41+
hooks:
42+
- id: misspelled-moveit
43+
name: misspelled-moveit
44+
description: MoveIt should be spelled exactly as MoveIt
45+
language: pygrep
46+
entry: Moveit|MoveIt!
47+
exclude: .pre-commit-config.yaml|README.md

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ env:
1616
- UPSTREAM_WORKSPACE=.rosinstall
1717

1818
jobs:
19-
- env: TEST=clang-format
2019
- env: TEST=code-coverage
2120
- compiler: clang
2221
env: DOCKER_IMAGE=moveit/moveit:master-source

core/src/stages/compute_ik.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ void ComputeIK::compute() {
277277
if (value.empty()) { // property undefined
278278
// determine IK link from eef/group
279279
if (!(link = eef_jmg ? robot_model->getLinkModel(eef_jmg->getEndEffectorParentGroup().second) :
280-
jmg->getOnlyOneEndEffectorTip())) {
280+
jmg->getOnlyOneEndEffectorTip())) {
281281
ROS_WARN_STREAM_NAMED("ComputeIK", "Failed to derive IK target link");
282282
return;
283283
}

core/test/test_interface_state.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ TEST(Interface, update) {
6262

6363
i.updatePriority(*i.begin(), Prio(6, std::numeric_limits<double>::infinity()));
6464
EXPECT_THAT(i.depths(), ::testing::ElementsAreArray({ 5, 3 })); // larger priority is ignored
65-
}
65+
}

demo/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
<depend>moveit_core</depend>
1717
<depend>rosparam_shortcuts</depend>
1818
<exec_depend>moveit_resources_panda_moveit_config</exec_depend>
19-
</package>
19+
</package>

0 commit comments

Comments
 (0)