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

1.x update clang format #31

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Changes from 1 commit
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
Next Next commit
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
  • Loading branch information
2bndy5 committed Feb 17, 2024
commit 31b927012da02fbaa63d47850208e15e543d80df
31 changes: 11 additions & 20 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -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 }}
11 changes: 11 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -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: