Skip to content

Commit af1ac2f

Browse files
authored
Add pre-commit hooks configuration (#1792)
Signed-off-by: Michael Carroll <michael@openrobotics.org>
1 parent 2d19f93 commit af1ac2f

File tree

163 files changed

+155
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+155
-256
lines changed

.github/ci-focal/before_cmake.sh

100644100755
File mode changed.

.github/ci/after_make.sh

100644100755
File mode changed.

.github/workflows/ci.yml

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v2
12+
- uses: actions/setup-python@v3
13+
- uses: pre-commit/action@v3.0.0
14+
with:
15+
extra_args: --all-files
1216
- name: Compile and test
1317
id: ci
1418
uses: gazebo-tooling/action-gz-ci@focal
@@ -22,6 +26,10 @@ jobs:
2226
steps:
2327
- name: Checkout
2428
uses: actions/checkout@v2
29+
- uses: actions/setup-python@v3
30+
- uses: pre-commit/action@v3.0.0
31+
with:
32+
extra_args: --all-files
2533
- name: Compile and test
2634
id: ci
2735
uses: gazebo-tooling/action-gz-ci@jammy

.github/workflows/triage.yml

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ jobs:
1616
COLUMN: Inbox
1717
GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }}
1818
CHECK_ORG_PROJECT: true
19-

.pre-commit-config.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: check-added-large-files
6+
args: ['--maxkb=500']
7+
- id: check-executables-have-shebangs
8+
- id: check-json
9+
- id: check-merge-conflict
10+
- id: check-shebang-scripts-are-executable
11+
- id: check-symlinks
12+
- id: check-toml
13+
- id: check-xml
14+
- id: check-yaml
15+
- id: destroyed-symlinks
16+
- id: end-of-file-fixer
17+
- id: mixed-line-ending
18+
- id: trailing-whitespace

COPYING

-2
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,3 @@
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
178-

api.md.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Gazebo @GZ_DESIGNATION_CAP@
22

33
Gazebo @GZ_DESIGNATION_CAP@ is a component in Gazebo, a set of libraries
4-
designed to rapidly develop robot and simulation applications.
4+
designed to rapidly develop robot and simulation applications.
55

66
**Useful links**
77

docker/Dockerfile.base

-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ RUN scripts/install_common_deps.sh
1313

1414
COPY docker/scripts/enable_gcc8.sh scripts/enable_gcc8.sh
1515
RUN scripts/enable_gcc8.sh
16-

examples/plugin/custom_component/CustomComponentPlugin.cc

-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@
2121
GZ_ADD_PLUGIN(examples::CustomComponentPlugin,
2222
gz::sim::System,
2323
examples::CustomComponentPlugin::ISystemConfigure)
24-

examples/plugin/hello_world/HelloWorld.cc

-3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,3 @@ void HelloWorld::PostUpdate(const gz::sim::UpdateInfo &_info,
5151
// higher (i.e. gz sim -v 3)
5252
gzmsg << msg << std::endl;
5353
}
54-
55-
56-

examples/plugin/reset_plugin/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ find_package(gz-sim7 REQUIRED)
99
set(GZ_SIM_VER ${gz-sim7_VERSION_MAJOR})
1010

1111
add_library(JointPositionRandomizer SHARED JointPositionRandomizer.cc)
12-
target_link_libraries(JointPositionRandomizer
12+
target_link_libraries(JointPositionRandomizer
1313
PRIVATE gz-plugin${GZ_PLUGIN_VER}::gz-plugin${GZ_PLUGIN_VER}
1414
PRIVATE gz-sim${GZ_SIM_VER}::core)

examples/plugin/reset_plugin/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# System Reset API
22

3-
This example uses the JointPositionRandomizer system to randomize the joint
3+
This example uses the JointPositionRandomizer system to randomize the joint
44
positions of a robot arm at every reset.
55

66

examples/scripts/blender/distort_mesh.py

100644100755
File mode changed.

examples/scripts/distributed/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ the GUI.
3131
You can run the same world in a standalone process as follows:
3232

3333
./standalone.sh
34-

examples/scripts/distributed/primary.sh

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44

55
gz sim -v 4 -z 100000000 --network-role primary --network-secondaries 3 $DIR/primary.sdf
6-

examples/scripts/distributed/secondary.sh

-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44

55
gz sim -s -v 4 -z 100000000 --network-role secondary $DIR/secondary.sdf
6-

examples/scripts/distributed_levels/primary.sh

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44

55
# --levels is implied by --network-role
66
gz sim -v 4 -z 100000000 --network-role primary --network-secondaries 2 $DIR/primary.sdf
7-

examples/scripts/distributed_levels/secondary.sdf

+33-33
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<sdf version="1.6">
1111
<world name="default">
1212

13-
13+
1414
<plugin
1515
filename="gz-sim-physics-system"
1616
name="gz::sim::systems::Physics">
1717
</plugin>
18-
1918

20-
19+
20+
2121

2222
<scene>
2323
<ambient>0.8 0.8 0.8 1.0</ambient>
@@ -40,7 +40,7 @@
4040
<direction>-0.5 0.1 -0.9</direction>
4141
</light>
4242

43-
43+
4444

4545
<model name="green_sphere">
4646
<pose>0 -1.5 2.5 0 0 0</pose>
@@ -74,7 +74,7 @@
7474
</visual>
7575
</link>
7676
</model>
77-
77+
7878

7979
<model name="yellow_box">
8080
<pose>0 1.5 2.5 0 0 0</pose>
@@ -108,9 +108,9 @@
108108
</visual>
109109
</link>
110110
</model>
111-
112111

113-
112+
113+
114114
<model name="block_0_A">
115115
<static>true</static>
116116
<pose>0.0 -1.5 -0.0 0 0.5235987755982988 0</pose>
@@ -171,7 +171,7 @@
171171
</visual>
172172
</link>
173173
</model>
174-
174+
175175
<model name="block_0_B">
176176
<static>true</static>
177177
<pose>0.0 1.5 -0.0 0 0.5235987755982988 0</pose>
@@ -232,7 +232,7 @@
232232
</visual>
233233
</link>
234234
</model>
235-
235+
236236
<model name="block_1_A">
237237
<static>true</static>
238238
<pose>2.598076211353316 -1.5 -1.4999999999999998 0 0.5235987755982988 0</pose>
@@ -293,7 +293,7 @@
293293
</visual>
294294
</link>
295295
</model>
296-
296+
297297
<model name="block_1_B">
298298
<static>true</static>
299299
<pose>2.598076211353316 1.5 -1.4999999999999998 0 0.5235987755982988 0</pose>
@@ -354,7 +354,7 @@
354354
</visual>
355355
</link>
356356
</model>
357-
357+
358358
<model name="block_2_A">
359359
<static>true</static>
360360
<pose>5.196152422706632 -1.5 -2.9999999999999996 0 0.5235987755982988 0</pose>
@@ -415,7 +415,7 @@
415415
</visual>
416416
</link>
417417
</model>
418-
418+
419419
<model name="block_2_B">
420420
<static>true</static>
421421
<pose>5.196152422706632 1.5 -2.9999999999999996 0 0.5235987755982988 0</pose>
@@ -476,7 +476,7 @@
476476
</visual>
477477
</link>
478478
</model>
479-
479+
480480
<model name="block_3_C">
481481
<static>true</static>
482482
<pose>7.794228634059948 0 -4.499999999999999 0 0.5235987755982988 0</pose>
@@ -537,7 +537,7 @@
537537
</visual>
538538
</link>
539539
</model>
540-
540+
541541
<model name="block_4_A">
542542
<static>true</static>
543543
<pose>10.392304845413264 -1.5 -5.999999999999999 0 0.5235987755982988 0</pose>
@@ -598,7 +598,7 @@
598598
</visual>
599599
</link>
600600
</model>
601-
601+
602602
<model name="block_4_B">
603603
<static>true</static>
604604
<pose>10.392304845413264 1.5 -5.999999999999999 0 0.5235987755982988 0</pose>
@@ -659,7 +659,7 @@
659659
</visual>
660660
</link>
661661
</model>
662-
662+
663663
<model name="block_5_A">
664664
<static>true</static>
665665
<pose>12.99038105676658 -1.5 -7.499999999999999 0 0.5235987755982988 0</pose>
@@ -720,7 +720,7 @@
720720
</visual>
721721
</link>
722722
</model>
723-
723+
724724
<model name="block_5_B">
725725
<static>true</static>
726726
<pose>12.99038105676658 1.5 -7.499999999999999 0 0.5235987755982988 0</pose>
@@ -781,7 +781,7 @@
781781
</visual>
782782
</link>
783783
</model>
784-
784+
785785

786786
<model name="end_block_A">
787787
<static>true</static>
@@ -851,7 +851,7 @@
851851

852852
<plugin name="gz::sim" filename="dummy">
853853

854-
854+
855855
<performer name="perf_green_sphere">
856856
<ref>green_sphere</ref>
857857
<geometry>
@@ -860,7 +860,7 @@
860860
</box>
861861
</geometry>
862862
</performer>
863-
863+
864864
<performer name="perf_yellow_box">
865865
<ref>yellow_box</ref>
866866
<geometry>
@@ -869,9 +869,9 @@
869869
</box>
870870
</geometry>
871871
</performer>
872-
873872

874-
873+
874+
875875
<level name="level_block_0_A">
876876
<pose>0.0 -1.5 -0.0 0 0 0</pose>
877877
<geometry>
@@ -882,7 +882,7 @@
882882
<buffer>1.0</buffer>
883883
<ref>block_0_A</ref>
884884
</level>
885-
885+
886886
<level name="level_block_0_B">
887887
<pose>0.0 1.5 -0.0 0 0 0</pose>
888888
<geometry>
@@ -893,7 +893,7 @@
893893
<buffer>1.0</buffer>
894894
<ref>block_0_B</ref>
895895
</level>
896-
896+
897897
<level name="level_block_1_A">
898898
<pose>2.598076211353316 -1.5 -1.4999999999999998 0 0 0</pose>
899899
<geometry>
@@ -904,7 +904,7 @@
904904
<buffer>1.0</buffer>
905905
<ref>block_1_A</ref>
906906
</level>
907-
907+
908908
<level name="level_block_1_B">
909909
<pose>2.598076211353316 1.5 -1.4999999999999998 0 0 0</pose>
910910
<geometry>
@@ -915,7 +915,7 @@
915915
<buffer>1.0</buffer>
916916
<ref>block_1_B</ref>
917917
</level>
918-
918+
919919
<level name="level_block_2_A">
920920
<pose>5.196152422706632 -1.5 -2.9999999999999996 0 0 0</pose>
921921
<geometry>
@@ -926,7 +926,7 @@
926926
<buffer>1.0</buffer>
927927
<ref>block_2_A</ref>
928928
</level>
929-
929+
930930
<level name="level_block_2_B">
931931
<pose>5.196152422706632 1.5 -2.9999999999999996 0 0 0</pose>
932932
<geometry>
@@ -937,7 +937,7 @@
937937
<buffer>1.0</buffer>
938938
<ref>block_2_B</ref>
939939
</level>
940-
940+
941941
<level name="level_block_3_C">
942942
<pose>7.794228634059948 0 -4.499999999999999 0 0 0</pose>
943943
<geometry>
@@ -948,7 +948,7 @@
948948
<buffer>1.0</buffer>
949949
<ref>block_3_C</ref>
950950
</level>
951-
951+
952952
<level name="level_block_4_A">
953953
<pose>10.392304845413264 -1.5 -5.999999999999999 0 0 0</pose>
954954
<geometry>
@@ -959,7 +959,7 @@
959959
<buffer>1.0</buffer>
960960
<ref>block_4_A</ref>
961961
</level>
962-
962+
963963
<level name="level_block_4_B">
964964
<pose>10.392304845413264 1.5 -5.999999999999999 0 0 0</pose>
965965
<geometry>
@@ -970,7 +970,7 @@
970970
<buffer>1.0</buffer>
971971
<ref>block_4_B</ref>
972972
</level>
973-
973+
974974
<level name="level_block_5_A">
975975
<pose>12.99038105676658 -1.5 -7.499999999999999 0 0 0</pose>
976976
<geometry>
@@ -981,7 +981,7 @@
981981
<buffer>1.0</buffer>
982982
<ref>block_5_A</ref>
983983
</level>
984-
984+
985985
<level name="level_block_5_B">
986986
<pose>12.99038105676658 1.5 -7.499999999999999 0 0 0</pose>
987987
<geometry>
@@ -992,7 +992,7 @@
992992
<buffer>1.0</buffer>
993993
<ref>block_5_B</ref>
994994
</level>
995-
995+
996996

997997

998998
</plugin>

examples/scripts/distributed_levels/secondary.sh

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
44

55
# --levels is implied by --network-role
66
gz sim -s -v 4 -z 100000000 --network-role secondary $DIR/secondary.sdf
7-

examples/scripts/log_video_recorder/log_video_recorder.sdf

-1
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,3 @@
132132
</gui>
133133
</world>
134134
</sdf>
135-

0 commit comments

Comments
 (0)