Skip to content

Commit b732819

Browse files
Merge pull request #56 from MarqRazz/pre-commit
Add pre-commit config and workflow
2 parents bdb778a + a5d0548 commit b732819

18 files changed

+494
-356
lines changed

.clang-format

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -2
4+
ConstructorInitializerIndentWidth: 2
5+
AlignEscapedNewlinesLeft: false
6+
AlignTrailingComments: true
7+
AllowAllParametersOfDeclarationOnNextLine: false
8+
AllowShortIfStatementsOnASingleLine: false
9+
AllowShortLoopsOnASingleLine: false
10+
AllowShortFunctionsOnASingleLine: None
11+
AlwaysBreakTemplateDeclarations: true
12+
AlwaysBreakBeforeMultilineStrings: false
13+
BreakBeforeBinaryOperators: false
14+
BreakBeforeTernaryOperators: false
15+
BreakConstructorInitializers: BeforeComma
16+
BinPackParameters: true
17+
ColumnLimit: 90
18+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
19+
DerivePointerBinding: false
20+
PointerBindsToType: true
21+
ExperimentalAutoDetectBinPacking: false
22+
IndentCaseLabels: true
23+
MaxEmptyLinesToKeep: 1
24+
NamespaceIndentation: None
25+
ObjCSpaceBeforeProtocolList: true
26+
PenaltyBreakBeforeFirstCallParameter: 19
27+
PenaltyBreakComment: 60
28+
PenaltyBreakString: 1
29+
PenaltyBreakFirstLessLess: 1000
30+
PenaltyExcessCharacter: 1000
31+
PenaltyReturnTypeOnItsOwnLine: 90
32+
SpacesBeforeTrailingComments: 2
33+
Cpp11BracedListStyle: false
34+
Standard: Auto
35+
IndentWidth: 2
36+
TabWidth: 2
37+
UseTab: Never
38+
IndentFunctionDeclarationAfterType: false
39+
SpacesInParentheses: false
40+
SpacesInAngles: false
41+
SpaceInEmptyParentheses: false
42+
SpacesInCStyleCastParentheses: false
43+
SpaceAfterControlStatementKeyword: true
44+
SpaceBeforeAssignmentOperators: true
45+
SpaceBeforeParens: Never
46+
ContinuationIndentWidth: 4
47+
SortIncludes: false
48+
SpaceAfterCStyleCast: false
49+
ReflowComments: false
50+
51+
# Configure each individual brace in BraceWrapping
52+
BreakBeforeBraces: Custom
53+
54+
# Control of individual brace wrapping cases
55+
BraceWrapping: {
56+
AfterClass: 'true',
57+
AfterControlStatement: 'true',
58+
AfterEnum : 'true',
59+
AfterFunction : 'true',
60+
AfterNamespace : 'true',
61+
AfterStruct : 'true',
62+
AfterUnion : 'true',
63+
BeforeCatch : 'true',
64+
BeforeElse : 'true',
65+
IndentBraces : 'false',
66+
SplitEmptyFunction: 'false'
67+
}
68+
...

.github/workflows/pre-commit.yaml

Lines changed: 14 additions & 0 deletions
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: [master]
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

.pre-commit-config.yaml

Lines changed: 44 additions & 0 deletions
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|^include/behaviortree_cpp/contrib/
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']

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
202202
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203203
See the License for the specific language governing permissions and
204204
limitations under the License.
205-

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,3 @@ wrap your Nodes into plugins that can be loaded at run-time.
2929
A lot of code is either inspired or copied from [Nav2](https://navigation.ros.org/).
3030

3131
For this reason, we retain the same license and copyright.
32-
33-

behaviortree_ros2/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ ament_target_dependencies(${PROJECT_NAME} ${THIS_PACKAGE_DEPS})
2626
######################################################
2727
# INSTALL
2828

29-
install(DIRECTORY include/ DESTINATION include/)
30-
29+
install(DIRECTORY include/ DESTINATION include/)
30+
3131
ament_export_include_directories(include)
3232
ament_export_dependencies(${THIS_PACKAGE_DEPS})
3333

0 commit comments

Comments
 (0)