Skip to content

Commit

Permalink
Merge pull request #1 from Alpaca-zip/feature/add_template
Browse files Browse the repository at this point in the history
Feature/add template
  • Loading branch information
Alpaca-zip authored Sep 10, 2023
2 parents fc4cdaf + f92eb0d commit f1c2c55
Show file tree
Hide file tree
Showing 9 changed files with 624 additions and 1 deletion.
75 changes: 75 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
BasedOnStyle: Google
ColumnLimit: 120
MaxEmptyLinesToKeep: 1
SortIncludes: false

Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
NamespaceIndentation: None
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentFunctionDeclarationAfterType: false

AlignEscapedNewlinesLeft: false
AlignTrailingComments: true

AllowAllParametersOfDeclarationOnNextLine: false
ExperimentalAutoDetectBinPacking: false
ObjCSpaceBeforeProtocolList: true
Cpp11BracedListStyle: false

AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: false

AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true

BinPackParameters: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true

PenaltyExcessCharacter: 50
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 1000
PenaltyBreakFirstLessLess: 10
PenaltyBreakString: 100
PenaltyReturnTypeOnItsOwnLine: 50

SpacesBeforeTrailingComments: 2
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterCStyleCast: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
...
50 changes: 50 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
Checks: '-*,
performance-*,
llvm-namespace-comment,
modernize-redundant-void-arg,
modernize-use-nullptr,
modernize-use-default,
modernize-use-override,
modernize-loop-convert,
readability-named-parameter,
readability-redundant-smartptr-get,
readability-redundant-string-cstr,
readability-simplify-boolean-expr,
readability-container-size-empty,
readability-identifier-naming,
'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
CheckOptions:
- key: llvm-namespace-comment.ShortNamespaceLines
value: '10'
- key: llvm-namespace-comment.SpacesBeforeComments
value: '2'
- key: readability-braces-around-statements.ShortStatementLines
value: '2'
# type names
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
# method names
- key: readability-identifier-naming.MethodCase
value: camelBack
# variable names
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ClassMemberSuffix
value: '_'
# const static or global variables are UPPER_CASE
- key: readability-identifier-naming.EnumConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.StaticConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.ClassConstantCase
value: UPPER_CASE
- key: readability-identifier-naming.GlobalVariableCase
value: UPPER_CASE
...
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## PR Type
<!--
Please select the type of changes you're introducing to the codebase:
-->
- [ ] Feature
- [ ] Bug fix
- [ ] Refactor
- [ ] Documentation
- [ ] Other

## Overview
-
<!--
Brief summary of the changes made in this PR.
-->

## Detail
-
<!--
In-depth description of the changes, especially if the changes are significant or complex.
-->

## Test
- [ ]
<!--
what was done to ensure it works.
Example:
- [ ] I have tested this change with gazebo
- [ ] I have tested this change with rosbag
-->

## Attention
-
<!--
Any particular attention or caution the reviewers should have regarding the PR.
-->
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: ROS1 Industrial CI
on:
pull_request:

jobs:
clang_format_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic # Replace noetic for your chosen distro.
CLANG_FORMAT_CHECK: file
CLANG_FORMAT_VERSION: "10"

clang_tidy_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic # Replace noetic for your chosen distro.
# UPSTREAM_WORKSPACE: dependencies.rosinstall
# BEFORE_BUILD_TARGET_WORKSPACE: 'apt update -q && python3 -m pip install ****'
CLANG_TIDY: pedantic

black_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic # Replace noetic for your chosen distro.
BLACK_CHECK: true

pylint_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic # Replace noetic for your chosen distro.
# UPSTREAM_WORKSPACE: dependencies.rosinstall
# BEFORE_BUILD_TARGET_WORKSPACE: 'apt update -q && python3 -m pip install ****'
PYLINT_ARGS: '--errors-only'
PYLINT_CHECK: true

catkin_lint_check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env:
ROS_DISTRO: noetic # Replace noetic for your chosen distro.
# UPSTREAM_WORKSPACE: dependencies.rosinstall
# BEFORE_BUILD_TARGET_WORKSPACE: 'apt update -q && python3 -m pip install ****'
CATKIN_LINT: true

build_check:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
fail-fast: false
matrix:
env:
- ROS_DISTRO: noetic # Replace noetic for your chosen distro.
ROS_REPO: main
# UPSTREAM_WORKSPACE: dependencies.rosinstall
# BEFORE_BUILD_TARGET_WORKSPACE: 'apt update -q && python3 -m pip install ****'
IMMEDIATE_TEST_OUTPUT: true
- ROS_DISTRO: noetic # Replace noetic for your chosen distro.
ROS_REPO: testing
# UPSTREAM_WORKSPACE: dependencies.rosinstall
# BEFORE_BUILD_TARGET_WORKSPACE: 'apt update -q && python3 -m pip install ****'
IMMEDIATE_TEST_OUTPUT: true

steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: run industrial_ci
uses: 'ros-industrial/industrial_ci@master'
env: ${{matrix.env}}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@ qtcreator-*

# Catkin custom files
CATKIN_IGNORE

# vscode
.vscode

# compiler logs
compile_commands.json
Loading

0 comments on commit f1c2c55

Please sign in to comment.