From 7b094a0d716c2f4ca551100fd48c3e5733c09872 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 16 Feb 2024 04:05:52 -0800 Subject: [PATCH 1/5] satisfy nRF24/.github#9 --- .clang-format | 31 +++++++++----------------- .github/workflows/build_arduino.yml | 2 ++ .github/workflows/build_linux.yml | 2 ++ .github/workflows/build_platformIO.yml | 2 ++ .github/workflows/build_rp2xxx.yml | 2 ++ .github/workflows/doxygen.yml | 3 ++- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.clang-format b/.clang-format index 5b8681ed..c02cf2f6 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_arduino.yml b/.github/workflows/build_arduino.yml index ae31b027..b73608b0 100644 --- a/.github/workflows/build_arduino.yml +++ b/.github/workflows/build_arduino.yml @@ -2,12 +2,14 @@ name: Arduino CLI build on: pull_request: + branches: [master, 1.x] types: [opened, reopened] paths: - ".github/workflows/build_arduino.yml" - "examples/**" push: + branches: [master, 1.x] paths: - ".github/workflows/build_arduino.yml" - "examples/**" diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index bdf51193..2cc2fb04 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, 1.x] types: [opened, reopened] paths: - "*.h" @@ -15,6 +16,7 @@ on: - "**pyRF24Network/*.cpp" - ".github/workflows/linux_build.yml" push: + branches: [master, 1.x] paths: - "*.h" - "*.cpp" diff --git a/.github/workflows/build_platformIO.yml b/.github/workflows/build_platformIO.yml index 6288a966..cff5fc75 100644 --- a/.github/workflows/build_platformIO.yml +++ b/.github/workflows/build_platformIO.yml @@ -2,6 +2,7 @@ name: PlatformIO build on: pull_request: + branches: [master, 1.x] types: [opened, reopened] paths: - ".github/workflows/build_platformIO.yml" @@ -9,6 +10,7 @@ on: - "examples/**" - "!examples/*.zip" push: + branches: [master, 1.x] paths: - ".github/workflows/build_platformIO.yml" - "library.json" diff --git a/.github/workflows/build_rp2xxx.yml b/.github/workflows/build_rp2xxx.yml index 1b482b24..3d2af456 100644 --- a/.github/workflows/build_rp2xxx.yml +++ b/.github/workflows/build_rp2xxx.yml @@ -2,6 +2,7 @@ name: Pico SDK build on: push: + branches: [master, 1.x] paths: - ".github/workflows/build_rp2xxx.yml" - "*.h" @@ -10,6 +11,7 @@ on: - "cmake/" - "examples_pico/*" pull_request: + branches: [master, 1.x] types: [opened, reopened] paths: - ".github/workflows/build_rp2xxx.yml" diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index bfefa1a6..2d181aa8 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -2,6 +2,7 @@ name: build Docs on: pull_request: + branches: [master, 1.x] types: [opened, reopened] paths: - "*.h" @@ -13,6 +14,7 @@ on: - "Doxyfile" - "library.properties" # get lib version from here push: + branches: [master, 1.x] paths: - "*.h" - "docs/**" @@ -23,7 +25,6 @@ on: - "Doxyfile" - "library.properties" # get lib version from here release: - branches: [master] types: [published, edited] workflow_dispatch: From fd38f4861b2bcb16adec08d67b5ffc34d97aaaf7 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 16 Feb 2024 04:07:28 -0800 Subject: [PATCH 2/5] ran clang-format --- RF24Network.cpp | 2 +- RF24Network.h | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/RF24Network.cpp b/RF24Network.cpp index fafe1ce6..d6edab8b 100644 --- a/RF24Network.cpp +++ b/RF24Network.cpp @@ -848,7 +848,7 @@ bool ESBNetwork::write(uint16_t to_node, uint8_t sendType) isAckType = true; /*if( ( (frame_buffer[7] % 2) && frame_buffer[6] == NETWORK_MORE_FRAGMENTS) ){ - isAckType = 0; + isAckType = 0; }*/ // Throw it away if it's not a valid address diff --git a/RF24Network.h b/RF24Network.h index 09b882cd..38a2da19 100644 --- a/RF24Network.h +++ b/RF24Network.h @@ -317,9 +317,9 @@ struct RF24NetworkFrame uint16_t message_size; /** - * On Arduino, the message buffer is just a pointer, and can be pointed to any memory location. - * On Linux the message buffer is a standard byte array, equal in size to the defined MAX_PAYLOAD_SIZE - */ + * On Arduino, the message buffer is just a pointer, and can be pointed to any memory location. + * On Linux the message buffer is a standard byte array, equal in size to the defined MAX_PAYLOAD_SIZE + */ #if defined(RF24_LINUX) uint8_t message_buffer[MAX_PAYLOAD_SIZE]; // Array to store the message #else @@ -334,15 +334,15 @@ struct RF24NetworkFrame RF24NetworkFrame() {} /** - * **Constructor for Linux platforms** - create a network frame with data - * Frames are constructed and handled differently on Arduino/AVR and Linux devices (`#if defined RF24_LINUX`) - * - * @param _header The RF24Network header to be stored in the frame - * @param _message The 'message' or data. - * @param _len The size of the 'message' or data. - * - * Frames are used internally and by external systems. See RF24NetworkHeader. - */ + * **Constructor for Linux platforms** - create a network frame with data + * Frames are constructed and handled differently on Arduino/AVR and Linux devices (`#if defined RF24_LINUX`) + * + * @param _header The RF24Network header to be stored in the frame + * @param _message The 'message' or data. + * @param _len The size of the 'message' or data. + * + * Frames are used internally and by external systems. See RF24NetworkHeader. + */ #if defined(RF24_LINUX) || defined(DOXYGEN_FORCED) RF24NetworkFrame(RF24NetworkHeader& _header, const void* _message = NULL, uint16_t _len = 0) : header(_header), message_size(_len) { @@ -402,10 +402,10 @@ class ESBNetwork * nrf_to_nrf radio1; * RF52Network network(radio1); // for nRF52xxx family * @endcode - * + * * @see v2.0 supports [nrf_to_nrf Arduino library](https://github.com/TMRh20/nrf_to_nrf) * for nrf52 chips' internal radio. - * + * * @param _radio The underlying radio driver instance */ ESBNetwork(radio_t& _radio); From e79e133633e88be930a0ec91bdbc3aa0a8bcbb91 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 17 Feb 2024 04:20:21 -0800 Subject: [PATCH 3/5] use a separate workflow to check code formatting also fix typo in branch name (v1.x, not 1.x) --- .github/workflows/build_arduino.yml | 11 ++--------- .github/workflows/build_linux.yml | 10 ++-------- .github/workflows/build_platformIO.yml | 11 +++-------- .github/workflows/build_rp2xxx.yml | 9 ++------- .github/workflows/clang_format.yml | 13 +++++++++++++ .github/workflows/doxygen.yml | 4 ++-- 6 files changed, 24 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/clang_format.yml diff --git a/.github/workflows/build_arduino.yml b/.github/workflows/build_arduino.yml index b73608b0..8d4f0261 100644 --- a/.github/workflows/build_arduino.yml +++ b/.github/workflows/build_arduino.yml @@ -2,27 +2,20 @@ name: Arduino CLI build on: pull_request: - branches: [master, 1.x] + branches: [master, v1.x] types: [opened, reopened] paths: - ".github/workflows/build_arduino.yml" - "examples/**" push: - branches: [master, 1.x] + branches: [master, v1.x] paths: - ".github/workflows/build_arduino.yml" - "examples/**" jobs: - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main - with: - ignore: '!examples|' - extensions: ino - build: - needs: check_formatting uses: nRF24/.github/.github/workflows/build_arduino.yaml@main with: sketch-paths: | diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 2cc2fb04..52afd898 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -2,7 +2,7 @@ name: Linux build on: pull_request: - branches: [master, 1.x] + branches: [master, v1.x] types: [opened, reopened] paths: - "*.h" @@ -16,7 +16,7 @@ on: - "**pyRF24Network/*.cpp" - ".github/workflows/linux_build.yml" push: - branches: [master, 1.x] + branches: [master, v1.x] paths: - "*.h" - "*.cpp" @@ -32,13 +32,7 @@ on: types: [created] jobs: - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main - with: - ignore: 'examples|examples_pico' - using_cmake: - needs: check_formatting uses: nRF24/.github/.github/workflows/build_linux_cmake.yaml@main with: rf24network-ref: ${{ github.sha }} diff --git a/.github/workflows/build_platformIO.yml b/.github/workflows/build_platformIO.yml index cff5fc75..533ed910 100644 --- a/.github/workflows/build_platformIO.yml +++ b/.github/workflows/build_platformIO.yml @@ -2,7 +2,7 @@ name: PlatformIO build on: pull_request: - branches: [master, 1.x] + branches: [master, v1.x] types: [opened, reopened] paths: - ".github/workflows/build_platformIO.yml" @@ -10,7 +10,7 @@ on: - "examples/**" - "!examples/*.zip" push: - branches: [master, 1.x] + branches: [master, v1.x] paths: - ".github/workflows/build_platformIO.yml" - "library.json" @@ -26,13 +26,8 @@ jobs: with: deploy-release: ${{ github.event_name == 'release' }} - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main - with: - extensions: ino - build: - needs: [check_formatting, validate_lib_json] + needs: [validate_lib_json] uses: nRF24/.github/.github/workflows/build_platformio.yaml@main with: example-path: ${{ matrix.example }} diff --git a/.github/workflows/build_rp2xxx.yml b/.github/workflows/build_rp2xxx.yml index 3d2af456..65ec7b77 100644 --- a/.github/workflows/build_rp2xxx.yml +++ b/.github/workflows/build_rp2xxx.yml @@ -2,7 +2,7 @@ name: Pico SDK build on: push: - branches: [master, 1.x] + branches: [master, v1.x] paths: - ".github/workflows/build_rp2xxx.yml" - "*.h" @@ -11,7 +11,7 @@ on: - "cmake/" - "examples_pico/*" pull_request: - branches: [master, 1.x] + branches: [master, v1.x] types: [opened, reopened] paths: - ".github/workflows/build_rp2xxx.yml" @@ -22,13 +22,8 @@ on: - "examples_pico/*" jobs: - check_formatting: - uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main - with: - ignore: '!examples_pico|' build: - needs: check_formatting uses: nRF24/.github/.github/workflows/build_pico_sdk.yaml@main with: board-id: ${{ matrix.board }} diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml new file mode 100644 index 00000000..88cb4701 --- /dev/null +++ b/.github/workflows/clang_format.yml @@ -0,0 +1,13 @@ +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 + with: + extensions: ino,c,cpp,h \ No newline at end of file diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index 2d181aa8..616b60f9 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -2,7 +2,7 @@ name: build Docs on: pull_request: - branches: [master, 1.x] + branches: [master, v1.x] types: [opened, reopened] paths: - "*.h" @@ -14,7 +14,7 @@ on: - "Doxyfile" - "library.properties" # get lib version from here push: - branches: [master, 1.x] + branches: [master, v1.x] paths: - "*.h" - "docs/**" From 28060e194af94bdb1ee0478c96ccba5b90c7178a Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 17 Feb 2024 04:27:39 -0800 Subject: [PATCH 4/5] 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 00000000..05a48fc6 --- /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" From 26b37a33eb68de818f3701c73119550b49dcfc08 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 17 Feb 2024 04:35:03 -0800 Subject: [PATCH 5/5] removed PR event types in CI triggers --- .github/workflows/build_arduino.yml | 1 - .github/workflows/build_linux.yml | 1 - .github/workflows/build_platformIO.yml | 1 - .github/workflows/build_rp2xxx.yml | 1 - .github/workflows/doxygen.yml | 1 - 5 files changed, 5 deletions(-) diff --git a/.github/workflows/build_arduino.yml b/.github/workflows/build_arduino.yml index 8d4f0261..c69a7097 100644 --- a/.github/workflows/build_arduino.yml +++ b/.github/workflows/build_arduino.yml @@ -3,7 +3,6 @@ name: Arduino CLI build on: pull_request: branches: [master, v1.x] - types: [opened, reopened] paths: - ".github/workflows/build_arduino.yml" - "examples/**" diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 52afd898..e7a8170a 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -3,7 +3,6 @@ name: Linux build on: pull_request: branches: [master, v1.x] - types: [opened, reopened] paths: - "*.h" - "*.cpp" diff --git a/.github/workflows/build_platformIO.yml b/.github/workflows/build_platformIO.yml index 533ed910..ef598c3d 100644 --- a/.github/workflows/build_platformIO.yml +++ b/.github/workflows/build_platformIO.yml @@ -3,7 +3,6 @@ name: PlatformIO build on: pull_request: branches: [master, v1.x] - types: [opened, reopened] paths: - ".github/workflows/build_platformIO.yml" - "library.json" diff --git a/.github/workflows/build_rp2xxx.yml b/.github/workflows/build_rp2xxx.yml index 65ec7b77..dd49212a 100644 --- a/.github/workflows/build_rp2xxx.yml +++ b/.github/workflows/build_rp2xxx.yml @@ -12,7 +12,6 @@ on: - "examples_pico/*" pull_request: branches: [master, v1.x] - types: [opened, reopened] paths: - ".github/workflows/build_rp2xxx.yml" - "*.h" diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index 616b60f9..d4ff9b3a 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -3,7 +3,6 @@ name: build Docs on: pull_request: branches: [master, v1.x] - types: [opened, reopened] paths: - "*.h" - "docs/**"