forked from jsk-ros-pkg/jsk_aerial_robot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jsk-ros-pkg#566 from Li-Jinjie/only_add_pre-commit
[Code Style] [merge after jsk-ros-pkg#565] add pre-commit tool
- Loading branch information
Showing
3 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
BasedOnStyle: Google | ||
AccessModifierOffset: -2 | ||
ConstructorInitializerIndentWidth: 2 | ||
AlignEscapedNewlinesLeft: false | ||
AlignTrailingComments: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: None | ||
AlwaysBreakTemplateDeclarations: true | ||
AlwaysBreakBeforeMultilineStrings: true | ||
BreakBeforeBinaryOperators: false | ||
BreakBeforeTernaryOperators: false | ||
BreakConstructorInitializersBeforeComma: true | ||
BinPackParameters: true | ||
ColumnLimit: 120 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
DerivePointerBinding: false | ||
PointerBindsToType: true | ||
ExperimentalAutoDetectBinPacking: false | ||
IndentCaseLabels: true | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 60 | ||
PenaltyBreakString: 1 | ||
PenaltyBreakFirstLessLess: 1000 | ||
PenaltyExcessCharacter: 1000 | ||
PenaltyReturnTypeOnItsOwnLine: 90 | ||
SpacesBeforeTrailingComments: 2 | ||
Cpp11BracedListStyle: false | ||
Standard: Auto | ||
IndentWidth: 2 | ||
TabWidth: 2 | ||
UseTab: Never | ||
IndentFunctionDeclarationAfterType: false | ||
SpacesInParentheses: false | ||
SpacesInAngles: false | ||
SpaceInEmptyParentheses: false | ||
SpacesInCStyleCastParentheses: false | ||
SpaceAfterControlStatementKeyword: true | ||
SpaceBeforeAssignmentOperators: true | ||
ContinuationIndentWidth: 4 | ||
SortIncludes: false | ||
SpaceAfterCStyleCast: false | ||
|
||
# Configure each individual brace in BraceWrapping | ||
BreakBeforeBraces: Custom | ||
|
||
# Control of individual brace wrapping cases | ||
BraceWrapping: | ||
AfterClass: true | ||
AfterControlStatement: 'true' | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: check-xml | ||
- id: check-json | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: check-added-large-files | ||
|
||
# Python | ||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
language: python | ||
args: [--line-length=120] | ||
|
||
# C++ | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v17.0.3 | ||
hooks: | ||
- id: clang-format | ||
|
||
# # YAML - still bad support for comments in YAML files | ||
# - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt | ||
# rev: 0.2.1 # or other specific tag | ||
# hooks: | ||
# - id: yamlfmt | ||
# args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '120'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters