Skip to content

Commit 1bacc3f

Browse files
committed
adding pre-commit
1 parent 6337feb commit 1bacc3f

File tree

5 files changed

+97
-25
lines changed

5 files changed

+97
-25
lines changed

.clang-format

+19-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
BasedOnStyle: Google
2+
BasedOnStyle: Google
33
AccessModifierOffset: -2
44
ConstructorInitializerIndentWidth: 2
55
AlignEscapedNewlinesLeft: false
@@ -8,15 +8,13 @@ AllowAllParametersOfDeclarationOnNextLine: false
88
AllowShortIfStatementsOnASingleLine: false
99
AllowShortLoopsOnASingleLine: false
1010
AllowShortFunctionsOnASingleLine: None
11-
AllowShortLoopsOnASingleLine: false
1211
AlwaysBreakTemplateDeclarations: true
1312
AlwaysBreakBeforeMultilineStrings: false
1413
BreakBeforeBinaryOperators: false
1514
BreakBeforeTernaryOperators: false
16-
BreakConstructorInitializersBeforeComma: false
17-
BreakConstructorInitializers: AfterColon
15+
BreakConstructorInitializers: BeforeComma
1816
BinPackParameters: true
19-
ColumnLimit: 90
17+
ColumnLimit: 90
2018
ConstructorInitializerAllOnOneLineOrOnePerLine: true
2119
DerivePointerBinding: false
2220
PointerBindsToType: true
@@ -31,15 +29,15 @@ PenaltyBreakString: 1
3129
PenaltyBreakFirstLessLess: 1000
3230
PenaltyExcessCharacter: 1000
3331
PenaltyReturnTypeOnItsOwnLine: 90
34-
SpacesBeforeTrailingComments: 3
35-
Cpp11BracedListStyle: true
36-
Standard: Auto
37-
IndentWidth: 2
38-
TabWidth: 2
39-
UseTab: Never
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: false
34+
Standard: Auto
35+
IndentWidth: 2
36+
TabWidth: 2
37+
UseTab: Never
4038
IndentFunctionDeclarationAfterType: false
4139
SpacesInParentheses: false
42-
SpacesInAngles: false
40+
SpacesInAngles: false
4341
SpaceInEmptyParentheses: false
4442
SpacesInCStyleCastParentheses: false
4543
SpaceAfterControlStatementKeyword: true
@@ -54,17 +52,16 @@ BreakBeforeBraces: Custom
5452

5553
# Control of individual brace wrapping cases
5654
BraceWrapping: {
57-
AfterClass: 'true'
58-
AfterControlStatement: 'true'
59-
AfterEnum : 'true'
60-
AfterFunction : 'true'
61-
AfterNamespace : 'true'
62-
AfterStruct : 'true'
63-
AfterUnion : 'true'
64-
BeforeCatch : 'true'
65-
BeforeElse : 'true'
55+
AfterClass: 'true',
56+
AfterControlStatement: 'true',
57+
AfterEnum : 'true',
58+
AfterFunction : 'true',
59+
AfterNamespace : 'true',
60+
AfterStruct : 'true',
61+
AfterUnion : 'true',
62+
BeforeCatch : 'true',
63+
BeforeElse : 'true',
6664
IndentBraces : 'false'
6765
SplitEmptyFunction: 'false'
6866
}
6967
...
70-

.github/workflows/pre-commit.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v3
14+
- uses: pre-commit/action@v3.0.1

.github/workflows/ros2-rolling.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: ros2-rolling
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
industrial_ci:
7+
strategy:
8+
matrix:
9+
env:
10+
- {ROS_DISTRO: rolling, ROS_REPO: main}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: 'ros-industrial/industrial_ci@master'
15+
env: ${{matrix.env}}
16+
with:
17+
package-name: plotjuggler

.github/workflows/ros2.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
matrix:
99
env:
1010
- {ROS_DISTRO: humble, ROS_REPO: main}
11-
- {ROS_DISTRO: rolling, ROS_REPO: main}
11+
- {ROS_DISTRO: iron, ROS_REPO: main}
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v3
1515
- uses: 'ros-industrial/industrial_ci@master'
1616
env: ${{matrix.env}}
1717
with:
18-
package-name: behaviortree_cpp
18+
package-name: plotjuggler

.pre-commit-config.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# To use:
3+
#
4+
# pre-commit run -a
5+
#
6+
# Or:
7+
#
8+
# pre-commit install # (runs every time you commit in git)
9+
#
10+
# To update this file:
11+
#
12+
# pre-commit autoupdate
13+
#
14+
# See https://github.com/pre-commit/pre-commit
15+
16+
exclude: ^3rdparty/|3rdparty
17+
repos:
18+
19+
# Standard hooks
20+
- repo: https://github.com/pre-commit/pre-commit-hooks
21+
rev: v4.5.0
22+
hooks:
23+
- id: check-added-large-files
24+
- id: check-ast
25+
- id: check-case-conflict
26+
- id: check-docstring-first
27+
- id: check-merge-conflict
28+
- id: check-symlinks
29+
- id: check-xml
30+
- id: check-yaml
31+
- id: debug-statements
32+
- id: end-of-file-fixer
33+
exclude_types: [svg]
34+
- id: mixed-line-ending
35+
- id: trailing-whitespace
36+
exclude_types: [svg]
37+
- id: fix-byte-order-marker
38+
39+
# CPP hooks
40+
- repo: https://github.com/pre-commit/mirrors-clang-format
41+
rev: v17.0.6
42+
hooks:
43+
- id: clang-format
44+
args: ['-fallback-style=none', '-i']

0 commit comments

Comments
 (0)