Skip to content

Commit 68df675

Browse files
committed
Jamulus.pro: Implement (n)make clang_format
This simplifies submission of properly formatted code for users with no editor/IDE integration of clang-format (jamulussoftware#1702).
1 parent f5c32e9 commit 68df675

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.clang-format-ignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# exclude third party code from clang-format checks
1+
# Exclude third party code from clang-format checks.
2+
#
3+
# This file is used by the clang-format-lint-action on Github.
4+
# When updating this list, remember to update Jamulus.pro's CLANG_SOURCES
5+
# as well.
26
./libs
37
./windows/nsProcess

.github/workflows/coding-style-check.yml

+2
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ jobs:
1717
- uses: DoozyX/clang-format-lint-action@2a28e3a8d9553f244243f7e1ff94f6685dff87be
1818
with:
1919
clangFormatVersion: 10
20+
# When updating the extension list, remember to update
21+
# Jamulus.pro's CLANG_SOURCES as well.
2022
extensions: 'cpp,h'

Jamulus.pro

+8
Original file line numberDiff line numberDiff line change
@@ -1169,3 +1169,11 @@ contains(CONFIG, "disable_version_check") {
11691169

11701170
ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64
11711171

1172+
# Enable formatting all code via `make clang_format`.
1173+
# Note: When extending the list of file extensions or when adding new code directories,
1174+
# be sure to update .github/workflows/coding-style-check.yml and .clang-format-ignore as well.
1175+
CLANG_FORMAT_SOURCES = $$files(*.cpp, true) $$files(*.h, true)
1176+
CLANG_FORMAT_SOURCES = $$find(CLANG_FORMAT_SOURCES, ^\(android|ios|mac|linux|src|windows\)/)
1177+
CLANG_FORMAT_SOURCES ~= s!^\(windows/nsProcess/|src/res/qrc_resources\.cpp\)\S*$!!g
1178+
clang_format.commands = 'clang-format -i $$CLANG_FORMAT_SOURCES'
1179+
QMAKE_EXTRA_TARGETS += clang_format

0 commit comments

Comments
 (0)