Skip to content

Commit

Permalink
Ci/add commit test2 (#11)
Browse files Browse the repository at this point in the history
* add-precommit

Signed-off-by: Masahiro Kubota <[email protected]>

* add precommit

Signed-off-by: Masahiro Kubota <[email protected]>

* modify

Signed-off-by: Masahiro Kubota <[email protected]>

* modify

Signed-off-by: Masahiro Kubota <[email protected]>

* modify

Signed-off-by: Masahiro Kubota <[email protected]>

* modify

Signed-off-by: Masahiro Kubota <[email protected]>

* delete redundant hook

Signed-off-by: Masahiro Kubota <[email protected]>

* add --fix arg

Signed-off-by: Masahiro Kubota <[email protected]>

* Revert "add --fix arg"

This reverts commit 4b06cca.

Signed-off-by: Masahiro Kubota <[email protected]>

* remove autoware-precommit

Signed-off-by: Masahiro Kubota <[email protected]>

* delete cache

Signed-off-by: Masahiro Kubota <[email protected]>

* modify precommit

Signed-off-by: Masahiro Kubota <[email protected]>

* modify precommit options

Signed-off-by: Masahiro Kubota <[email protected]>

* add config

Signed-off-by: Masahiro Kubota <[email protected]>

---------

Signed-off-by: Masahiro Kubota <[email protected]>
  • Loading branch information
masahiro-kubota authored Jan 8, 2025
1 parent ec49a04 commit d3d28c9
Show file tree
Hide file tree
Showing 8 changed files with 216 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This file is automatically synced from:
# https://github.com/autowarefoundation/sync-file-templates
# To make changes, update the source repository and follow the guidelines in its README.

# Modified from https://github.com/ament/ament_lint/blob/master/ament_clang_format/ament_clang_format/configuration/.clang-format
Language: Cpp
BasedOnStyle: Google

AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AllowShortFunctionsOnASingleLine: InlineOnly
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
BreakBeforeBraces: Custom
ColumnLimit: 100
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 2
DerivePointerAlignment: false
PointerAlignment: Middle
ReflowComments: true
IncludeCategories:
# C++ system headers
- Regex: <[a-z_]*>
Priority: 6
CaseSensitive: true
# C system headers
- Regex: <.*\.h>
Priority: 5
CaseSensitive: true
# Boost headers
- Regex: boost/.*
Priority: 4
CaseSensitive: true
# Message headers
- Regex: .*_msgs/.*
Priority: 3
CaseSensitive: true
- Regex: .*_srvs/.*
Priority: 3
CaseSensitive: true
# Other Package headers
- Regex: <.*>
Priority: 2
CaseSensitive: true
# Local package headers
- Regex: '".*"'
Priority: 1
CaseSensitive: true
19 changes: 19 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1

- name: Run pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --config .pre-commit-config.yaml --all-files
9 changes: 9 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md for all rules.
default: true
MD013: false
MD024:
siblings_only: true
MD033: false
MD041: false
MD046: false
MD049: false
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This file is automatically synced from:
# https://github.com/autowarefoundation/sync-file-templates
# To make changes, update the source repository and follow the guidelines in its README.

# https://pre-commit.ci/#configuration
ci:
autofix_commit_msg: "style(pre-commit): autofix"
# we already have our own daily update mechanism, we set this to quarterly
autoupdate_schedule: quarterly
autoupdate_commit_msg: "ci(pre-commit): quarterly autoupdate"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
args: [--unsafe]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.43.0
hooks:
- id: markdownlint
args: [-c, .markdownlint.yaml, --fix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint

- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.10.0
hooks:
- id: prettier-launch-xml
- id: prettier-package-xml
- id: ros-include-guard
- id: sort-package-xml

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.5
hooks:
- id: clang-format
types_or: [c++, c, cuda]

- repo: https://github.com/cpplint/cpplint
rev: 2.0.0
hooks:
- id: cpplint
args: [--quiet]
exclude: .cu
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file is automatically synced from:
# https://github.com/autowarefoundation/sync-file-templates
# To make changes, update the source repository and follow the guidelines in its README.

*.param.yaml
*.rviz
24 changes: 24 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file is automatically synced from:
# https://github.com/autowarefoundation/sync-file-templates
# To make changes, update the source repository and follow the guidelines in its README.

printWidth: 100
tabWidth: 2
overrides:
- files: package.xml
options:
printWidth: 1000
xmlSelfClosingSpace: false
xmlWhitespaceSensitivity: ignore

- files: "*.launch.xml"
options:
printWidth: 200
xmlSelfClosingSpace: false
xmlWhitespaceSensitivity: ignore

- files: "*.xacro"
options:
printWidth: 200
xmlSelfClosingSpace: false
xmlWhitespaceSensitivity: ignore
26 changes: 26 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is automatically synced from:
# https://github.com/autowarefoundation/sync-file-templates
# To make changes, update the source repository and follow the guidelines in its README.

extends: default

ignore: |
*.param.yaml
rules:
braces:
level: error
max-spaces-inside: 1 # To format with Prettier
comments:
level: error
min-spaces-from-content: 1 # To be compatible with C++ and Python
document-start:
level: error
present: false # Don't need document start markers
line-length: disable # Delegate to Prettier
truthy:
level: error
check-keys: false # To allow 'on' of GitHub Actions
quoted-strings:
level: error
required: only-when-needed # To keep consistent style
20 changes: 20 additions & 0 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file is automatically synced from:
# https://github.com/autowarefoundation/sync-file-templates
# To make changes, update the source repository and follow the guidelines in its README.

# Modified from https://github.com/ament/ament_lint/blob/ebd524bb9973d5ec1dc48a670ce54f958a5a0243/ament_cpplint/ament_cpplint/main.py#L64-L120
set noparent
linelength=100
includeorder=standardcfirst
filter=-build/c++11 # we do allow C++11
filter=-build/c++17 # we allow <filesystem>
filter=-build/namespaces_literals # we allow using namespace for literals
filter=-runtime/references # we consider passing non-const references to be ok
filter=-whitespace/braces # we wrap open curly braces for namespaces, classes and functions
filter=-whitespace/indent # we don't indent keywords like public, protected and private with one space
filter=-whitespace/newline # we allow the developer to decide about newline at the end of file (it's clashing with clang-format)
filter=-whitespace/parens # we allow closing parenthesis to be on the next line
filter=-whitespace/semicolon # we allow the developer to decide about whitespace after a semicolon
filter=-build/header_guard # we automatically fix the names of header guards using pre-commit
filter=-build/include_order # we use the custom include order
filter=-build/include_subdir # we allow the style of "foo.hpp"

0 comments on commit d3d28c9

Please sign in to comment.