From 2cbce5650f7e81907e5dc0bb1cc5b2b7eb9bc33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Kol=C3=A5s?= Date: Thu, 14 Sep 2023 15:09:20 +0200 Subject: [PATCH 1/5] made ros2 compatible version --- .clang-format | 99 +++++++++++++++---------- .github/issue_template/bug-template.yml | 64 ++++++++++++++++ .github/issue_template/task-template.md | 13 +++- .gitignore | 1 + docker/Dockerfile | 4 +- 5 files changed, 138 insertions(+), 43 deletions(-) create mode 100644 .github/issue_template/bug-template.yml diff --git a/.clang-format b/.clang-format index 0e7c0d5..7200764 100644 --- a/.clang-format +++ b/.clang-format @@ -1,77 +1,88 @@ --- -# BasedOnStyle: WebKit -AccessModifierOffset: -4 -AlignAfterOpenBracket: DontAlign -AlignConsecutiveAssignments: false +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: false +AlignConsecutiveAssignments: true AlignConsecutiveDeclarations: false AlignEscapedNewlines: Right -AlignOperands: false -AlignTrailingComments: false +AlignOperands: true +AlignTrailingComments: true +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false +AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: No +AlwaysBreakTemplateDeclarations: MultiLine BinPackArguments: true BinPackParameters: true -BraceWrapping: +BraceWrapping: + AfterCaseLabel: false AfterClass: false AfterControlStatement: false AfterEnum: false - AfterFunction: true + AfterFunction: false AfterNamespace: false AfterObjCDeclaration: false AfterStruct: false AfterUnion: false + AfterExternBlock: false BeforeCatch: false BeforeElse: false IndentBraces: false SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true -BreakBeforeBinaryOperators: All -BreakBeforeBraces: WebKit +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Stroustrup BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false -BreakConstructorInitializers: BeforeComma +BreakConstructorInitializers: BeforeColon BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true -ColumnLimit: 0 +ColumnLimit: 160 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 -Cpp11BracedListStyle: false +Cpp11BracedListStyle: true +DeriveLineEnding: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: false -ForEachMacros: +FixNamespaceComments: true +ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH +IncludeBlocks: Preserve IncludeCategories: - - Regex: '^"config\.h"' - Priority: -1 - # The main header for a source file automatically gets category 0 - - Regex: '^<.*SoftLink.h>' - Priority: 4 - - Regex: '^".*SoftLink.h"' - Priority: 3 - - Regex: '^<.*>' + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 + SortPriority: 0 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + SortPriority: 0 - Regex: '.*' Priority: 1 + SortPriority: 0 IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' IndentCaseLabels: false -IndentWidth: 4 +IndentGotoLabels: true +IndentPPDirectives: None +IndentWidth: 2 IndentWrappedFunctionNames: false JavaScriptQuotes: Leave JavaScriptWrapImports: true @@ -80,36 +91,46 @@ MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 NamespaceIndentation: None -ObjCBlockIndentWidth: 4 -ObjCSpaceAfterProperty: true +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false ObjCSpaceBeforeProtocolList: true PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Left +PointerAlignment: Right ReflowComments: true SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false -SpaceAfterTemplateKeyword: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true -SpaceBeforeCpp11BracedList: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false +SpacesInConditionalStatement: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: Cpp11 -TabWidth: 8 -UseTab: Never ---- -Language: ObjC -PointerAlignment: Right -... +SpaceBeforeSquareBrackets: false +Standard: Latest +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 2 +UseCRLF: false +UseTab: ForIndentation +... \ No newline at end of file diff --git a/.github/issue_template/bug-template.yml b/.github/issue_template/bug-template.yml new file mode 100644 index 0000000..7bd634c --- /dev/null +++ b/.github/issue_template/bug-template.yml @@ -0,0 +1,64 @@ +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["bug", "triage"] +projects: ["octo-org/1", "octo-org/44"] +assignees: + - octocat +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: contact + attributes: + label: Contact Details + description: How can we get in touch with you if we need more info? + placeholder: ex. email@example.com + validations: + required: false + - type: textarea + id: what-happened + attributes: + label: What happened? + description: Also tell us, what did you expect to happen? + placeholder: Tell us what you see! + value: "A bug happened!" + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of our software are you running? + options: + - 1.0.2 (Default) + - 1.0.3 (Edge) + default: 0 + validations: + required: true + - type: dropdown + id: browsers + attributes: + label: What browsers are you seeing the problem on? + multiple: true + options: + - Firefox + - Chrome + - Safari + - Microsoft Edge + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/issue_template/task-template.md b/.github/issue_template/task-template.md index 2c19a20..10881cf 100644 --- a/.github/issue_template/task-template.md +++ b/.github/issue_template/task-template.md @@ -8,8 +8,17 @@ assignees: '' --- -**Time estimate:** XX hours -**Deadline:** DD.MONTH +**Time estimate:** +**Deadline:** **Description of task:** DESCRIPTION +**Time estimate:** hours +## Suggested Workflow +- + +## Specifications +- + +## Contacts +- <@name> - , diff --git a/.gitignore b/.gitignore index 5d05913..a8ef3df 100644 --- a/.gitignore +++ b/.gitignore @@ -207,6 +207,7 @@ cython_debug/ # ROS devel/ +install/ logs/ build/ bin/ diff --git a/docker/Dockerfile b/docker/Dockerfile index 101fee6..6890e3a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ -FROM ros:noetic +FROM ros:humble -ARG distro=noetic +ARG distro=humble ENV DEBIAN_FRONTEND=noninteractive SHELL ["/bin/bash", "-c"] From bfaf4c2f66296a25b588112704fc1ee70cd8733e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Kol=C3=A5s?= Date: Thu, 14 Sep 2023 15:21:32 +0200 Subject: [PATCH 2/5] made ros2 compatible version --- .github/workflows/clang-format-checker.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang-format-checker.yml b/.github/workflows/clang-format-checker.yml index 8ca33b8..88c311f 100644 --- a/.github/workflows/clang-format-checker.yml +++ b/.github/workflows/clang-format-checker.yml @@ -1,9 +1,14 @@ name: Check C++ code format with clang-format on: - pull_request: - branches: [main] + push: + branches: [ main ] + workflow_dispatch: + pull_request: + types: [opened, reopened] + branches: [ main ] + jobs: clang-format: runs-on: ubuntu-latest From e60e799200b5e6ec2d2896d1151715ea714b419c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Kol=C3=A5s?= Date: Thu, 14 Sep 2023 15:26:33 +0200 Subject: [PATCH 3/5] removed repo specific stuff from docker-publish and made more flexible formatter actions --- .github/workflows/clang-format-checker.yml | 4 ++-- .github/workflows/clang-formatter.yml | 9 +++++--- .github/workflows/docker-publish.yml | 23 +++++---------------- .github/workflows/python-format-checker.yml | 7 ++++++- .github/workflows/python-formatter.yml | 6 +++++- 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/clang-format-checker.yml b/.github/workflows/clang-format-checker.yml index 88c311f..28d0f4d 100644 --- a/.github/workflows/clang-format-checker.yml +++ b/.github/workflows/clang-format-checker.yml @@ -4,11 +4,11 @@ on: push: branches: [ main ] workflow_dispatch: - + pull_request: types: [opened, reopened] branches: [ main ] - + jobs: clang-format: runs-on: ubuntu-latest diff --git a/.github/workflows/clang-formatter.yml b/.github/workflows/clang-formatter.yml index 884e525..f787c4a 100644 --- a/.github/workflows/clang-formatter.yml +++ b/.github/workflows/clang-formatter.yml @@ -2,9 +2,12 @@ name: Format C++ code with clang-format on: push: - branches: [main] - # pull_request: - # branches: [main] + branches: [ main ] + workflow_dispatch: + + pull_request: + types: [opened, reopened] + branches: [ main ] jobs: clang-format: diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 98adbd0..194b489 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -3,7 +3,12 @@ name: Publish Docker image to GHCR on: push: branches: [ main ] + workflow_dispatch: + pull_request: + types: [opened, reopened] + branches: [ main ] + env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} @@ -19,24 +24,6 @@ jobs: - name: Checkout own repository uses: actions/checkout@v3 - # vortex_msgs needs to be in the same location as the rest of the vortex-auv packages - - name: Checkout vortex_msgs - uses: actions/checkout@v3 - with: - repository: 'vortexntnu/vortex-msgs' - path: './vortex-msgs' - - name: Move vortex_msgs - run: mv ./vortex-msgs ../vortex-msgs - - # robot_localization needs to be in the same location as the rest of the vortex-auv packages - - name: Checkout robot_localization - uses: actions/checkout@v3 - with: - repository: 'vortexntnu/robot_localization' - path: './robot_localization' - - name: Move robot_localization - run: mv ./robot_localization ../robot_localization - - name: Log in to the Container registry uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: diff --git a/.github/workflows/python-format-checker.yml b/.github/workflows/python-format-checker.yml index ffe3bfe..cec7e5c 100644 --- a/.github/workflows/python-format-checker.yml +++ b/.github/workflows/python-format-checker.yml @@ -1,8 +1,13 @@ name: Check format of python code with black on: + push: + branches: [ main ] + workflow_dispatch: + pull_request: - branches: [main] + types: [opened, reopened] + branches: [ main ] jobs: lint: diff --git a/.github/workflows/python-formatter.yml b/.github/workflows/python-formatter.yml index aa69516..830a84e 100644 --- a/.github/workflows/python-formatter.yml +++ b/.github/workflows/python-formatter.yml @@ -2,8 +2,12 @@ name: Format python code with black on: push: - branches: [main] + branches: [ main ] + workflow_dispatch: + pull_request: + types: [opened, reopened] + branches: [ main ] jobs: lint: From 0ab7d600743bc267839b16df1dce3b18dbb0fb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Kol=C3=A5s?= Date: Thu, 14 Sep 2023 15:27:20 +0200 Subject: [PATCH 4/5] removed file I accidentally added --- .github/issue_template/bug-template.yml | 64 ------------------------- 1 file changed, 64 deletions(-) delete mode 100644 .github/issue_template/bug-template.yml diff --git a/.github/issue_template/bug-template.yml b/.github/issue_template/bug-template.yml deleted file mode 100644 index 7bd634c..0000000 --- a/.github/issue_template/bug-template.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Bug Report -description: File a bug report -title: "[Bug]: " -labels: ["bug", "triage"] -projects: ["octo-org/1", "octo-org/44"] -assignees: - - octocat -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this bug report! - - type: input - id: contact - attributes: - label: Contact Details - description: How can we get in touch with you if we need more info? - placeholder: ex. email@example.com - validations: - required: false - - type: textarea - id: what-happened - attributes: - label: What happened? - description: Also tell us, what did you expect to happen? - placeholder: Tell us what you see! - value: "A bug happened!" - validations: - required: true - - type: dropdown - id: version - attributes: - label: Version - description: What version of our software are you running? - options: - - 1.0.2 (Default) - - 1.0.3 (Edge) - default: 0 - validations: - required: true - - type: dropdown - id: browsers - attributes: - label: What browsers are you seeing the problem on? - multiple: true - options: - - Firefox - - Chrome - - Safari - - Microsoft Edge - - type: textarea - id: logs - attributes: - label: Relevant log output - description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. - render: shell - - type: checkboxes - id: terms - attributes: - label: Code of Conduct - description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) - options: - - label: I agree to follow this project's Code of Conduct - required: true From 1959d653b9aaf43be98e284eb2ce02ad1d2f2680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eirik=20Kol=C3=A5s?= Date: Thu, 14 Sep 2023 16:32:15 +0200 Subject: [PATCH 5/5] removed template, because it is now in the .github repo --- .github/issue_template/task-template.md | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .github/issue_template/task-template.md diff --git a/.github/issue_template/task-template.md b/.github/issue_template/task-template.md deleted file mode 100644 index 10881cf..0000000 --- a/.github/issue_template/task-template.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: Task template -about: 'Use this template when defining a new task in an issue. Make sure to fill - out all the fields. ' -title: "[TASK]" -labels: '' -assignees: '' - ---- - -**Time estimate:** -**Deadline:** - -**Description of task:** DESCRIPTION -**Time estimate:** hours - -## Suggested Workflow -- - -## Specifications -- - -## Contacts -- <@name> - ,