From 31b927012da02fbaa63d47850208e15e543d80df Mon Sep 17 00:00:00 2001
From: Brendan <2bndy5@gmail.com>
Date: Sat, 17 Feb 2024 05:20:19 -0800
Subject: [PATCH 1/3] update clang-format config
use separate workflow to check code format
remove PR event types from CI triggers
only run CI on release branches and PRs to release branches
---
.clang-format | 31 +++++++++++-------------------
.github/workflows/build_linux.yml | 7 ++-----
.github/workflows/clang_format.yml | 11 +++++++++++
.github/workflows/doxygen.yml | 4 ++--
4 files changed, 26 insertions(+), 27 deletions(-)
create mode 100644 .github/workflows/clang_format.yml
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 924f72a..121c5fc 100644
--- a/.github/workflows/build_linux.yml
+++ b/.github/workflows/build_linux.yml
@@ -2,7 +2,7 @@ name: Linux build
on:
pull_request:
- types: [opened, reopened]
+ branches: [master, v1.x]
paths:
- "*.h"
- "*.cpp"
@@ -12,6 +12,7 @@ on:
- "!**Makefile" # old build system is not tested in this workflow
- ".github/workflows/build_linux.yml"
push:
+ branches: [master, v1.x]
paths:
- "*.h"
- "*.cpp"
@@ -28,11 +29,7 @@ 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 d15c1d0d712d99417c455eeb0df6e572a214aa79 Mon Sep 17 00:00:00 2001
From: Brendan <2bndy5@gmail.com>
Date: Sat, 17 Feb 2024 05:20:32 -0800
Subject: [PATCH 2/3] ran clang-format
---
examples/ncurses/RF24Gateway_ncurses.cpp | 40 +++++++++----------
.../ncursesInt/RF24Gateway_ncursesInt.cpp | 34 ++++++++--------
2 files changed, 37 insertions(+), 37 deletions(-)
diff --git a/examples/ncurses/RF24Gateway_ncurses.cpp b/examples/ncurses/RF24Gateway_ncurses.cpp
index b7058d7..e9ac56b 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 a500706fb3407e3e1fe9d3f2886e228bc2de4f67 Mon Sep 17 00:00:00 2001
From: Brendan <2bndy5@gmail.com>
Date: Sat, 17 Feb 2024 05:20:41 -0800
Subject: [PATCH 3/3] 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"