-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
329 changed files
with
23,000 additions
and
21,518 deletions.
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,55 @@ | ||
--- | ||
BasedOnStyle: Microsoft | ||
AlignArrayOfStructures: Left | ||
AllowShortBlocksOnASingleLine: Always | ||
AllowShortCaseLabelsOnASingleLine: true | ||
AllowShortFunctionsOnASingleLine: All | ||
BraceWrapping: | ||
AfterCaseLabel: true | ||
AfterClass: true | ||
AfterControlStatement: Always | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: false | ||
AfterObjCDeclaration: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
BeforeLambdaBody: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: false | ||
SplitEmptyRecord: false | ||
SplitEmptyNamespace: false | ||
BreakArrays: false | ||
BreakBeforeTernaryOperators: false | ||
BreakInheritanceList: AfterComma | ||
BreakStringLiterals: false | ||
ColumnLimit: 0 | ||
ConstructorInitializerIndentWidth: 2 | ||
ContinuationIndentWidth: 2 | ||
IncludeBlocks: Regroup | ||
IndentRequiresClause: false | ||
IndentWidth: 2 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
PenaltyBreakTemplateDeclaration: 1000000 | ||
PointerAlignment: Left | ||
SpaceAfterTemplateKeyword: false | ||
SpaceBeforeParens: Custom | ||
SpaceBeforeParensOptions: | ||
AfterControlStatements: false | ||
AfterForeachMacros: false | ||
AfterIfMacros: false | ||
SpacesInContainerLiterals: false | ||
TabWidth: 2 | ||
BracedInitializerIndentWidth: 2 | ||
NamespaceIndentation: All | ||
IncludeCategories: | ||
- Regex: '^\<.*\>' | ||
Priority: 1 | ||
CaseSensitive: false | ||
- Regex: '^".*"' | ||
Priority: 2 | ||
CaseSensitive: 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,99 @@ | ||
Checks: > | ||
-*, | ||
bugprone-*, | ||
-bugprone-easily-swappable-parameters, | ||
-bugprone-branch-clone, | ||
cppcoreguidelines-avoid-goto, | ||
cppcoreguidelines-init-variables, | ||
cppcoreguidelines-no-malloc, | ||
cppcoreguidelines-prefer-member-initializer, | ||
cppcoreguidelines-virtual-class-destructor, | ||
misc-const-correctness, | ||
misc-header-include-cycle, | ||
misc-include-cleaner, | ||
misc-misleading-identifier, | ||
misc-misplaced-const, | ||
misc-new-delete-overloads, | ||
misc-non-copyable-objects, | ||
misc-redundant-expression, | ||
misc-static-assert, | ||
misc-throw-by-value-catch-by-reference, | ||
misc-unconventional-assign-operator, | ||
misc-uniqueptr-reset-release, | ||
misc-unused-*, | ||
modernize-avoid-*, | ||
-modernize-avoid-bind, | ||
modernize-concat-nested-namespaces, | ||
modernize-deprecated-*, | ||
modernize-loop-convert, | ||
modernize-make-*, | ||
modernize-min-max-use-initializer-list, | ||
modernize-raw-string-literal, | ||
modernize-redundant-void-arg, | ||
modernize-replace-*, | ||
modernize-unary-static-assert, | ||
modernize-use-bool-literals, | ||
modernize-use-emplace, | ||
modernize-use-equals-*, | ||
modernize-use-noexcept, | ||
modernize-use-nullptr, | ||
modernize-use-override, | ||
modernize-use-starts-ends-with, | ||
modernize-use-using, | ||
boost-use-to-string, | ||
performance-faster-string-find, | ||
performance-for-range-copy, | ||
performance-implicit-conversion-in-loop, | ||
performance-inefficient-*, | ||
-performance-inefficient-string-concatenation, | ||
performance-move-const-arg, | ||
performance-no-automatic-move, | ||
performance-noexcept-destructor, | ||
performance-noexcept-swap, | ||
performance-trivially-destructible, | ||
performance-type-promotion-in-math-fn, | ||
performance-unnecessary-*, | ||
readability-avoid-*, | ||
readability-const-return-type, | ||
readability-container-*, | ||
readability-static-accessed-through-instance, | ||
readability-delete-null-pointer, | ||
readability-duplicate-include, | ||
readability-identifier-naming, | ||
readability-implicit-bool-conversion, | ||
readability-inconsistent-declaration-parameter-name, | ||
readability-make-member-function-const, | ||
readability-math-missing-parentheses, | ||
readability-misleading-indentation, | ||
readability-misplaced-array-index, | ||
readability-named-parameter, | ||
readability-non-const-parameter, | ||
readability-operators-representation, | ||
readability-qualified-auto, | ||
readability-redundant-*, | ||
readability-reference-to-constructed-temporary, | ||
readability-simplify-subscript-expr, | ||
readability-string-compare, | ||
readability-use-std-min-max | ||
HeaderFilterRegex: 'ontologenius/include/ontologenius/*' | ||
CheckOptions: | ||
- { key: readability-identifier-naming.NamespaceCase, value: lower_case } | ||
- { key: readability-identifier-naming.ClassCase, value: CamelCase } | ||
- { key: readability-identifier-naming.StructCase, value: CamelCase } | ||
- { key: readability-identifier-naming.StructSuffix, value: _t } | ||
- { key: readability-identifier-naming.FunctionCase, value: camelBack } | ||
- { key: readability-identifier-naming.VariableCase, value: lower_case } | ||
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case } | ||
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ } | ||
- { key: readability-identifier-naming.EnumCase, value: CamelCase } | ||
- { key: readability-identifier-naming.EnumSuffix, value: _e } | ||
- { key: readability-identifier-naming.EnumConstantCase, value: lower_case } | ||
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE } | ||
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case } | ||
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ } | ||
- { key: readability-operators-representation.BinaryOperators, value: '&&;&=;&;|;~;!;!=;||;|=;^;^=' } | ||
- { key: misc-const-correctness.AnalyzeValues, value: false } | ||
- { key: misc-include-cleaner.DeduplicateFindings, value: false } | ||
ExtraArgsBefore: | ||
- '-frelaxed-template-template-args' |
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,78 @@ | ||
#!/usr/bin/env python | ||
|
||
# Run clang-tidy recursively and parallel on directory | ||
# Usage: run-clang-tidy sourcedir builddir excludedirs extensions | ||
# extensions and excludedirs are specified as comma-separated | ||
# string without dot, e.g. 'c,cpp' | ||
# e.g. run-clang-tidy . build test,other c,cpp file | ||
|
||
import os, sys, subprocess, multiprocessing | ||
import json | ||
|
||
manager = multiprocessing.Manager() | ||
failedfiles = manager.list() | ||
|
||
# Get absolute paths from arguments | ||
print("Arguments: " + str(sys.argv)) | ||
sourcedir = os.path.abspath(sys.argv[1]) | ||
print("Source directory: " + sourcedir) | ||
builddir = os.path.abspath(sys.argv[2]) | ||
print("Build directory: " + builddir) | ||
# If exclude dirs is not empty, split it into a tuple | ||
excludedirs = () | ||
if len(sys.argv) > 3 and sys.argv[3]: | ||
excludedirs = tuple([os.path.join(sourcedir, s) for s in sys.argv[3].split(',')]) | ||
# If the build directory is not the same as the source directory, exclude it | ||
if not sourcedir == builddir: | ||
excludedirs = excludedirs + (builddir,) | ||
|
||
print("Exclude directories: " + str(excludedirs)) | ||
# Split extensions into a tuple | ||
extensions = () | ||
if(len(sys.argv) >= 4): | ||
extensions = tuple([("." + s) for s in sys.argv[4].split(',')]) | ||
print("Extensions: " + str(extensions)) | ||
|
||
def runclangtidy(filepath): | ||
print("Checking: " + filepath) | ||
proc = subprocess.Popen(f'clang-tidy -warnings-as-errors=* -p {builddir} {filepath}', shell=True) | ||
if proc.wait() != 0: | ||
failedfiles.append(filepath) | ||
|
||
def collectfiles(dir, exclude, exts): | ||
collectedfiles = [] | ||
for root, dirs, files in os.walk(dir): | ||
root = os.path.abspath(root) | ||
for file in files: | ||
filepath = os.path.join(root, file) | ||
if (len(exclude) == 0 or not filepath.startswith(exclude)) and filepath.endswith(exts): | ||
collectedfiles.append(filepath) | ||
return collectedfiles | ||
|
||
def collectcompiledfiles(dir, builddir): | ||
collectedfiles = [] | ||
if(builddir): | ||
compile_file = open(builddir + '/compile_commands.json') | ||
if compile_file is not None: | ||
compile_data = json.load(compile_file) | ||
for line in compile_data: | ||
filepath = line["file"] | ||
if dir in filepath and not builddir in filepath: | ||
collectedfiles.append(filepath) | ||
|
||
return collectedfiles | ||
|
||
# Define the pool AFTER the global variables and subprocess function because WTF python | ||
# See: https://stackoverflow.com/questions/41385708/multiprocessing-example-giving-attributeerror | ||
pool = multiprocessing.Pool() | ||
files = collectcompiledfiles(sourcedir, builddir) | ||
if len(files) == 0: | ||
files = collectfiles(sourcedir, excludedirs, extensions) | ||
pool.map(runclangtidy, files) | ||
pool.close() | ||
pool.join() | ||
if len(failedfiles) > 0: | ||
print("Errors in " + str(len(failedfiles)) + " files") | ||
sys.exit(1) | ||
print("No errors found") | ||
sys.exit(0) |
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
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,64 @@ | ||
name: ROS2 CI | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'resources/*' | ||
pull_request: | ||
paths-ignore: | ||
- 'docs/**' | ||
- 'resources/*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
include: | ||
- operating-system: ubuntu-22.04 | ||
ros_distro: humble | ||
distro: jammy | ||
- operating-system: ubuntu-22.04 | ||
ros_distro: iron | ||
distro: jammy | ||
env: | ||
ROS_CI_DESKTOP: ${{ matrix.distro }} | ||
CI_SOURCE_PATH: $(pwd) | ||
ROS_DISTRO: ${{ matrix.ros_distro }} | ||
steps: | ||
- name: Setup ROS | ||
uses: ros-tooling/[email protected] | ||
with: | ||
required-ros-distributions: ${{ matrix.ros_distro }} | ||
|
||
- name: Install deps | ||
run: | | ||
sudo apt install dpkg | ||
sudo apt install -y qtbase5-dev qtdeclarative5-dev | ||
sudo apt install -y libcppunit-dev libcurl4-openssl-dev | ||
sudo apt-get install python3-rosdep | ||
sudo apt install ros-cmake-modules | ||
sudo apt install ros-$ROS_DISTRO-std-msgs ros-$ROS_DISTRO-pluginlib | ||
source /opt/ros/$ROS_DISTRO/setup.bash | ||
- name: Setup Workspace | ||
run: | | ||
source /opt/ros/$ROS_DISTRO/setup.bash | ||
cmake --version | ||
cd $GITHUB_WORKSPACE | ||
mkdir -p ros2_ws/src/ontologenius | ||
cd ros2_ws | ||
colcon build --symlink-install | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
path: ros2_ws/src/ontologenius | ||
|
||
- name: Build | ||
run: | | ||
cd $GITHUB_WORKSPACE/ros2_ws | ||
source install/setup.bash | ||
export ROS_LOCALHOST_ONLY=1 | ||
colcon build --symlink-install |
Oops, something went wrong.