Skip to content

Commit

Permalink
Coding style: Require clang-format 13
Browse files Browse the repository at this point in the history
We currently use clang-format 10 which has shown to produce unexpected
output. This is annoying for PR submitters as the CI forces non-optimal
code layout, especially when submitters use a later clang-format version
which does not show this behavior.

This commit changes CI to use clang-format 13 and updates relevant
clang-format inline docs.

Related: jamulussoftware#2552
  • Loading branch information
hoffie committed Mar 28, 2022
1 parent 0bbd298 commit 28ec87b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
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
4 changes: 2 additions & 2 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
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

0 comments on commit 28ec87b

Please sign in to comment.