Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .config/clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---

# See https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html for documentation of these options
BasedOnStyle: Google
IndentWidth: 2
ColumnLimit: 120

AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: false
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: MultiLine
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeComma
CompactNamespaces: false
ContinuationIndentWidth: 2
ConstructorInitializerIndentWidth: 0
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
# Headers in <> with .h extension (best guess at C system headers)
- Regex: '<([A-Za-z0-9\Q/-_\E])+\.h>'
Priority: 1
# Headers in <> without extension (C++ system headers)
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
Priority: 2
# Headers in <> with other extensions.
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
Priority: 3
# Headers in ""
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
Priority: 4
IndentAccessModifiers: false
IndentPPDirectives: BeforeHash
PackConstructorInitializers: Never
PointerAlignment: Middle
ReferenceAlignment: Middle
ReflowComments: false
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SpacesBeforeTrailingComments: 2
13 changes: 13 additions & 0 deletions .config/copyright.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2025-present Polymath Robotics, Inc. All rights reserved

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
19 changes: 19 additions & 0 deletions .cpplint.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Because of cpplint's config file assumptions, this can't be contained in .config/ directory
linelength=256

# TODO(emerson) we need to apply a copyright check, maybe not via this tool though
filter=-legal/copyright
# TODO(emerson) we want these, but the style as enforced here is probably not quite right for us
filter=-build/header_guard
filter=-build/c++17

# Per our style guide, we want to allow the use of non-const reference passing for output parameters
filter=-runtime/references

# Disable all formatting checks, this is handled by clang-format
filter=-readability/braces
filter=-whitespace/braces
filter=-whitespace/indent
filter=-whitespace/newline
filter=-whitespace/parens
filter=-whitespace/semicolon
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---

name: Build and test
"on":
pull_request:
push:
branches:
- main

jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- ros: humble
ubuntu: jammy
- ros: jazzy
ubuntu: noble
- ros: rolling
ubuntu: noble
name: ROS 2 ${{ matrix.ros }}
container:
image: ghcr.io/ros-tooling/setup-ros-docker/setup-ros-docker-ubuntu-${{ matrix.ubuntu }}:latest
env:
ROS_DISTRO: ${{ matrix.ros }}
PIP_BREAK_SYSTEM_PACKAGES: 1
steps:
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-ci@v0.4
with:
target-ros2-distro: ${{ matrix.ros }}
- uses: actions/upload-artifact@v4
with:
name: colcon-logs-${{ matrix.ros }}
path: ros_ws/log
18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: pre-commit

"on":
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: sudo apt-get update && sudo apt-get install libxml2-utils
- uses: pre-commit/action@v3.0.1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Colcon
/build/
/install/
/log/
25 changes: 0 additions & 25 deletions .gitlab-ci.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# See https://pre-commit.com for more information on these settings
repos:
# Generally useful checks provided by pre-commit
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: end-of-file-fixer
- id: forbid-submodules
- id: mixed-line-ending
- id: trailing-whitespace
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
hooks:
- id: ruff-format
- id: ruff
args: [--fix]
# C++ formatting
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.7
hooks:
- id: clang-format
args: ["--style=file:.config/clang-format"]
# C++ linting
- repo: https://github.com/cpplint/cpplint
rev: 2.0.0
hooks:
- id: cpplint
args: ["--config=.cpplint.cfg", --quiet, --output=sed]
# Markdown
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.28
hooks:
- id: pymarkdown
args: [-d, MD013, fix]
# XML
- repo: https://github.com/emersonknapp/ament_xmllint
rev: v0.1
hooks:
- id: ament_xmllint
# YAML
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.29.0
hooks:
- id: yamllint
args: [-d, "{extends: default, rules: {line-length: {max: 256}, commas: false}}"]
# CMake
- repo: https://github.com/cmake-lint/cmake-lint
rev: 1.4.3
hooks:
- id: cmakelint
args: [--linelength=140]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: insert-license
types_or: [python, cmake, shell]
name: Copyright headers for Python/CMake
args: [
--license-filepath, .config/copyright.txt,
--comment-style, '#',
--allow-past-years,
--no-extra-eol,
]
- id: insert-license
types_or: [c++, c]
name: Copyright headers for C/C++
args: [
--license-filepath, .config/copyright.txt,
--comment-style, '//',
--allow-past-years,
]
18 changes: 18 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
line-length = 120
indent-width = 4

[format]
preview = true
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "lf"

[lint]
select = ["E4", "E7", "E9", "F", "I"]
# Rules intended for future application
# select = ["N", "D", "C90", "PTH", "UP", "PERF", "RUF"]
ignore = []
fixable = ["ALL"]
unfixable = []
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Notes

## v0.1.0
## v0.0.0
__INITIAL RELEASE__

### Features
Expand Down
Loading