From bfa78c6d575517b22abb1eb9b090e924e15277b4 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 16 Feb 2024 04:55:45 -0800 Subject: [PATCH 1/4] satisfy nRF24/.github#9 --- .clang-format | 31 +++++++++++-------------------- .github/workflows/build_linux.yml | 2 ++ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/.clang-format b/.clang-format index 5b8681e..c02cf2f 100644 --- a/.clang-format +++ b/.clang-format @@ -14,13 +14,13 @@ AlignTrailingComments: true AllowAllArgumentsOnNextLine: true AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortEnumsOnASingleLine: true -AllowShortBlocksOnASingleLine: Always +AllowShortEnumsOnASingleLine: false +AllowShortBlocksOnASingleLine: Empty AllowShortCaseLabelsOnASingleLine: true AllowShortFunctionsOnASingleLine: All AllowShortLambdasOnASingleLine: All -AllowShortIfStatementsOnASingleLine: WithoutElse -AllowShortLoopsOnASingleLine: true +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: Yes @@ -67,10 +67,7 @@ DeriveLineEnding: false DerivePointerAlignment: false DisableFormat: false EmptyLineBeforeAccessModifier: Always -# --- -# only in v13+ -# EmptyLineAfterAccessModifier: Leave -# --- +EmptyLineAfterAccessModifier: Leave ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true IncludeBlocks: Preserve @@ -89,10 +86,7 @@ IncludeCategories: CaseSensitive: false IncludeIsMainRegex: "(Test)?$" IncludeIsMainSourceRegex: "" -# --- -# only in v13+ -# IndentAccessModifiers: false -# --- +IndentAccessModifiers: false IndentCaseLabels: true IndentCaseBlocks: false IndentGotoLabels: false @@ -117,15 +111,12 @@ PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 PenaltyIndentedWhitespace: 0 PointerAlignment: Left -# --- -# only in v13+ -# ReferenceAlignment: Right -# --- +ReferenceAlignment: Pointer ReflowComments: true -# --- -# only in v13+ -# ShortNamespaceLines: 0 -# --- +SpacesInLineCommentPrefix: + Maximum: -1 + Minimum: 0 +ShortNamespaceLines: 0 # Sort**** is about sorting include/using statements alphabetically SortIncludes: false SortUsingDeclarations: false diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index b229419..759497e 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -2,6 +2,7 @@ name: Linux build on: pull_request: + branches: [master] types: [opened, reopened] paths: - "*.h" @@ -12,6 +13,7 @@ on: - "!**Makefile" # old build system is not tested in this workflow - ".github/workflows/build_linux.yml" push: + branches: [master] paths: - "*.h" - "*.cpp" From 128f658bf2f8ca043a12123cea952b88faa11519 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 16 Feb 2024 04:58:25 -0800 Subject: [PATCH 2/4] ran clang-format --- RF24Gateway.h | 4 +- examples/ncurses/RF24Gateway_ncurses.cpp | 40 +++++++++---------- .../ncursesInt/RF24Gateway_ncursesInt.cpp | 34 ++++++++-------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/RF24Gateway.h b/RF24Gateway.h index 0a0ca7e..b28f681 100644 --- a/RF24Gateway.h +++ b/RF24Gateway.h @@ -273,12 +273,12 @@ class ESBGateway /** * A type definition of the template class `ESBGateway` to maintain backward compatibility. - * + * * ```.cpp * RF24 radio(7, 8); * RF24Network network(radio); * RF24Mesh mesh(radio, network); - * + * * RF24Gateway gateway(radio, network, mesh); * // is equivalent to * ESBGateway, RF24>, ESBNetwork, RF24> gateway(radio, network, mesh); diff --git a/examples/ncurses/RF24Gateway_ncurses.cpp b/examples/ncurses/RF24Gateway_ncurses.cpp index ecbde8f..7e0f360 100644 --- a/examples/ncurses/RF24Gateway_ncurses.cpp +++ b/examples/ncurses/RF24Gateway_ncurses.cpp @@ -1,21 +1,21 @@ /** -* RF24Gateway NCurses interface - TMRh20 2015 -* This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network. -* -* The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway:
-* a: Interface statistics from /proc/net/dev
-* b: RF24Mesh address/id assignments
-* c: RF24Network/Radio information
-* d: Active IP connections (optional)
-* -* **Requirements: NCurses** -* Install NCurses: apt-get install libncurses5-dev -* -* **Controls** -* Type 'h' to view the help menu -* -* -*/ + * RF24Gateway NCurses interface - TMRh20 2015 + * This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network. + * + * The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway:
+ * a: Interface statistics from /proc/net/dev
+ * b: RF24Mesh address/id assignments
+ * c: RF24Network/Radio information
+ * d: Active IP connections (optional)
+ * + * **Requirements: NCurses** + * Install NCurses: apt-get install libncurses5-dev + * + * **Controls** + * Type 'h' to view the help menu + * + * + */ #include #include @@ -141,9 +141,9 @@ int main() { /** - * The gateway handles all IP traffic (marked as EXTERNAL_DATA_TYPE) and passes it to the associated network interface - * RF24Network user payloads are loaded into the user cache - */ + * The gateway handles all IP traffic (marked as EXTERNAL_DATA_TYPE) and passes it to the associated network interface + * RF24Network user payloads are loaded into the user cache + */ if (millis() - mesh_timer > 30000 && mesh.getNodeID()) { //Every 30 seconds, test mesh connectivity diff --git a/examples/ncursesInt/RF24Gateway_ncursesInt.cpp b/examples/ncursesInt/RF24Gateway_ncursesInt.cpp index bf9c213..166b18b 100644 --- a/examples/ncursesInt/RF24Gateway_ncursesInt.cpp +++ b/examples/ncursesInt/RF24Gateway_ncursesInt.cpp @@ -1,21 +1,21 @@ /** -* RF24Gateway NCurses interface - TMRh20 2015-2022 -* This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network. -* -* The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway:
-* a: Interface statistics from /proc/net/dev
-* b: RF24Mesh address/id assignments
-* c: RF24Network/Radio information
-* d: Active IP connections (optional)
-* -* **Requirements: NCurses** -* Install NCurses: apt-get install libncurses5-dev -* -* **Controls** -* Type 'h' to view the help menu -* -* -*/ + * RF24Gateway NCurses interface - TMRh20 2015-2022 + * This is a generic tool for nodes supporting or combining with RF24Ethernet and/or RF24Network. + * + * The tool provides a simple interface for monitoring information and activity regarding the RF24Gateway:
+ * a: Interface statistics from /proc/net/dev
+ * b: RF24Mesh address/id assignments
+ * c: RF24Network/Radio information
+ * d: Active IP connections (optional)
+ * + * **Requirements: NCurses** + * Install NCurses: apt-get install libncurses5-dev + * + * **Controls** + * Type 'h' to view the help menu + * + * + */ #include #include From f4b552f005213e1a5bb83a749bfff8795d95e528 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 17 Feb 2024 05:11:58 -0800 Subject: [PATCH 3/4] use a separate workflow to check code format add v1.x branch to CI triggers remove PR event types from CI triggers --- .github/workflows/build_linux.yml | 8 ++------ .github/workflows/clang_format.yml | 11 +++++++++++ .github/workflows/doxygen.yml | 4 ++-- 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/clang_format.yml diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 759497e..05bf7bd 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -2,8 +2,7 @@ name: Linux build on: pull_request: - branches: [master] - types: [opened, reopened] + branches: [master, v1.x] paths: - "*.h" - "*.cpp" @@ -13,7 +12,7 @@ on: - "!**Makefile" # old build system is not tested in this workflow - ".github/workflows/build_linux.yml" push: - branches: [master] + branches: [master, v1.x] paths: - "*.h" - "*.cpp" @@ -30,11 +29,8 @@ env: BUILD_TYPE: Release jobs: - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main using_cmake: - needs: check_formatting uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main with: compiler: ${{ matrix.toolchain.compiler }} diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml new file mode 100644 index 0000000..f82a4b6 --- /dev/null +++ b/.github/workflows/clang_format.yml @@ -0,0 +1,11 @@ +name: check code formatting + +on: + push: + branches: [master, v1.x] + pull_request: + branches: [master, v1.x] + +jobs: + check_formatting: + uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index b291dfb..870702f 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -2,7 +2,7 @@ name: build Docs on: pull_request: - types: [opened, reopened] + branches: [master, v1.x] paths: - "*.h" - "*.md" @@ -12,6 +12,7 @@ on: - ".github/workflows/doxygen.yml" - "Doxyfile" push: + branches: [master, v1.x] paths: - "*.h" - "*.md" @@ -21,7 +22,6 @@ on: - ".github/workflows/doxygen.yml" - "Doxyfile" release: - branches: [master] types: [published, edited] workflow_dispatch: From 781f1ac3bc821fc57006d46e904b980d5b5d1e82 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 17 Feb 2024 05:12:22 -0800 Subject: [PATCH 4/4] enable dependabot --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..05a48fc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "weekly"