Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clang format #41

Merged
merged 6 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
Expand Down Expand Up @@ -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
Expand All @@ -89,10 +86,7 @@ IncludeCategories:
CaseSensitive: false
IncludeIsMainRegex: "(Test)?$"
IncludeIsMainSourceRegex: ""
# ---
# only in v13+
# IndentAccessModifiers: false
# ---
IndentAccessModifiers: false
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: false
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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"
9 changes: 2 additions & 7 deletions .github/workflows/build_arduino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,20 @@ name: Arduino CLI build

on:
pull_request:
types: [opened, reopened]
branches: [master]
paths:
- ".github/workflows/build_arduino.yml"
- "examples/**"

push:
branches: [master]
paths:
- ".github/workflows/build_arduino.yml"
- "examples/**"

jobs:
check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: 'utility|clock-arch.c|clock-arch.h|Dns.cpp|Dns.h'
extensions: ino,cpp,h

build:
needs: check_formatting
uses: nRF24/.github/.github/workflows/build_arduino.yaml@main
with:
sketch-paths: |
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/build_platformIO.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PlatformIO build

on:
pull_request:
types: [opened, reopened]
branches: [master]
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
Expand All @@ -12,6 +12,7 @@ on:
- "!Dns.*"
- "!clock-arch.*"
push:
branches: [master]
paths:
- ".github/workflows/build_platformIO.yml"
- "library.json"
Expand All @@ -30,14 +31,8 @@ jobs:
with:
deploy-release: ${{ github.event_name == 'release' }}

check_formatting:
uses: nRF24/.github/.github/workflows/cpp_lint.yaml@main
with:
ignore: 'utility|clock-arch.c|clock-arch.h|Dns.cpp|Dns.h'
extensions: ino,cpp,h

build:
needs: [check_formatting, validate_lib_json]
needs: [validate_lib_json]
if:
uses: nRF24/.github/.github/workflows/build_platformio.yaml@main
with:
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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:
ignore: 'utility|clock-arch.c|clock-arch.h|Dns.cpp|Dns.h'
extensions: ino,c,cpp,h
4 changes: 2 additions & 2 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: DoxyGen build

on:
pull_request:
types: [opened, reopened]
branches: [master]
paths:
- "*.h"
- "docs/**"
Expand All @@ -14,6 +14,7 @@ on:
- "Doxyfile"
- "library.properties" # get lib version from here
push:
branches: [master]
paths:
- "*.h"
- "docs/**"
Expand All @@ -25,7 +26,6 @@ on:
- "Doxyfile"
- "library.properties" # get lib version from here
release:
branches: [master]
types: [published, edited]
workflow_dispatch:

Expand Down
24 changes: 12 additions & 12 deletions RF24Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,24 +352,24 @@ void serialip_appcall(void)
// Only call this if the TCP window has already been re-opened, the connection is being polled, but no data
// has been acked
if (!(u->state & (UIP_CLIENT_CLOSE | UIP_CLIENT_REMOTECLOSED)))
{

if (u->windowOpened == true && u->state & UIP_CLIENT_RESTART && millis() - u->restartTime > u->restartInterval)
{
u->restartTime = millis();

if (u->windowOpened == true && u->state & UIP_CLIENT_RESTART && millis() - u->restartTime > u->restartInterval)
{
u->restartTime = millis();
#if defined RF24ETHERNET_DEBUG_CLIENT || defined ETH_DEBUG_L1
Serial.println();
Serial.print(millis());
Serial.println();
Serial.print(millis());
#if UIP_CONNECTION_TIMEOUT > 0
Serial.print(F(" UIPClient Re-Open TCP Window, time remaining before abort: "));
Serial.println(UIP_CONNECTION_TIMEOUT - (millis() - u->connectTimer));
Serial.print(F(" UIPClient Re-Open TCP Window, time remaining before abort: "));
Serial.println(UIP_CONNECTION_TIMEOUT - (millis() - u->connectTimer));
#endif
#endif
u->restartInterval += 500;
u->restartInterval = rf24_min(u->restartInterval, 7000);
uip_restart();
u->restartInterval += 500;
u->restartInterval = rf24_min(u->restartInterval, 7000);
uip_restart();
}
}
}
}

/*******Close**********/
Expand Down