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

Code: Use clang-format 13 #2559

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 3 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
# Style for Clang-Format version 10
# https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# Style for clang-format version 13
# https://releases.llvm.org/13.0.0/tools/clang/docs/ClangFormatStyleOptions.html
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
# Alignment of Consecutive Assignments/Declarations/Macros can be changed to `AcrossEmptyLinesAndComments` with Clang-Format version 12
# Alignment of Consecutive Assignments/Declarations/Macros can be changed to `AcrossEmptyLinesAndComments` now that we require clang-format >=12
#AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
#AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
#AlignConsecutiveMacros: AcrossEmptyLinesAndComments
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coding-style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:

jobs:
clang-format:
name: Verify Clang-Format compliance
name: Verify clang-format (v13) compliance
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@2a28e3a8d9553f244243f7e1ff94f6685dff87be
- uses: DoozyX/clang-format-lint-action@9ea72631b74e61ce337d0839a90e76180e997283
with:
clangFormatVersion: 10
clangFormatVersion: 13
# When updating the extension list, remember to update
# Jamulus.pro's CLANG_SOURCES as well.
extensions: 'cpp,h,mm'
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ If a feature or function can be achieved in another way by another system or met

You can use your editor's or IDE's clang-format support to accomplish that.
On the command line, you can run `make clang_format` to do the same before committing.
Please use the same clang-format version which we use.
Other versions might produce slightly different output.
You can find the currently used version in the [workflow definition](https://github.com/jamulussoftware/jamulus/blob/master/.github/workflows/coding-style-check.yml#L20].

Do not use diff/patch to send your code changes but create a Github fork of the Jamulus code and create a Pull Request when you are done.

Expand Down
20 changes: 10 additions & 10 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,16 +856,16 @@ if ( GetNumericIniSet ( IniXMLDocument, "server", "centservaddrtype", static_cas
directoryType = static_cast<EDirectoryType> ( iValue );
}
else
// clang-format on
if ( GetNumericIniSet ( IniXMLDocument,
"server",
"directorytype",
static_cast<int> ( AT_NONE ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
{
directoryType = static_cast<EDirectoryType> ( iValue );
}
// clang-format on
if ( GetNumericIniSet ( IniXMLDocument,
"server",
"directorytype",
static_cast<int> ( AT_NONE ),
static_cast<int> ( AT_CUSTOM ),
iValue ) )
{
directoryType = static_cast<EDirectoryType> ( iValue );
}

// clang-format off
// TODO compatibility to old version < 3.9.0
Expand Down