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

Work around different clang-format versions #1774

Merged
merged 1 commit into from
Oct 26, 2022
Merged

Work around different clang-format versions #1774

merged 1 commit into from
Oct 26, 2022

Conversation

jubalh
Copy link
Member

@jubalh jubalh commented Oct 26, 2022

Locally I have clang-format 15.0.2.
Our CI runs ubuntu-20.04 so it has 10.0.

Seems like a default value changed but I can't find it. When I still had clang-format 14.x everything was fine and checking: https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#clang-format

I only see irrelevant things.

Someone on the llvm IRC channel sais "there is no guarantee" and "maybe a regression or intended change".
But seems like noone knows which setting could be the one we need.

Since I don't have a better solution for now I will just edit this by hand to apply to the clang-format version we have on the CI. Will look into updating this one.

But in any case it would be best if the configuration file could have this setting so formatting works the same for all contributors.

Locally I have clang-format 15.0.2.
Our CI runs ubuntu-20.04 so it has 10.0.

Seems like a default value changed but I can't find it.
When I still had clang-format 14.x everything was fine and checking:
https://releases.llvm.org/15.0.0/tools/clang/docs/ReleaseNotes.html#clang-format

I only see irrelevant things.

Someone on the llvm IRC channel sais "there is no guarantee" and "maybe
a regression or intended change".
But seems like noone knows which setting could be the one we need.

Since I don't have a better solution for now I will just edit this by
hand to apply to the clang-format version we have on the CI.
Will look into updating this one.

But in any case it would be best if the configuration file could have
this setting so formatting works the same for all contributors.
@jubalh jubalh added the tests label Oct 26, 2022
@jubalh jubalh self-assigned this Oct 26, 2022
@jubalh jubalh merged commit 49ab1f3 into master Oct 26, 2022
@jubalh jubalh deleted the fix/format branch October 26, 2022 13:28
@sjaeckel
Copy link
Member

sjaeckel commented Apr 4, 2023

FYI: running make format with clang-format-16 results in

$  git diff -U1
diff --git a/src/config/color.c b/src/config/color.c
index 7676253f..9c1998f5 100644
--- a/src/config/color.c
+++ b/src/config/color.c
@@ -61,3 +61,3 @@ static struct color_pair_cache
         int16_t fg, bg;
-    } * pairs;
+    }* pairs;
     int size;
diff --git a/src/plugins/c_api.c b/src/plugins/c_api.c
index cda40c4d..8daf633d 100644
--- a/src/plugins/c_api.c
+++ b/src/plugins/c_api.c
@@ -457,3 +457,3 @@ c_command_callback(PluginCommand* command, gchar** args)
     CommandWrapper* wrapper = command->callback;
-    void (*f)(gchar * *args) = wrapper->func;
+    void (*f)(gchar** args) = wrapper->func;
     f(args);
diff --git a/tests/unittests/test_cmd_otr.c b/tests/unittests/test_cmd_otr.c
index ccd219de..267e06d4 100644
--- a/tests/unittests/test_cmd_otr.c
+++ b/tests/unittests/test_cmd_otr.c
@@ -169,3 +169,3 @@ test_with_command_and_connection_status(char* command, void* cmd_func, jabber_co
 
-    gboolean (*func)(ProfWin * window, const char* const command, gchar** args) = cmd_func;
+    gboolean (*func)(ProfWin* window, const char* const command, gchar** args) = cmd_func;
     gboolean result = func(NULL, CMD_OTR, args);

@jubalh jubalh added this to the next milestone Apr 14, 2023
jubalh added a commit that referenced this pull request Apr 14, 2023
Instead of running clang-format outselves on the old Ubuntu version.
This let's us easily configure which version of clang-format we want to
execute.

Used action:
https://github.com/marketplace/actions/clang-format-check

Properly fix:
#1774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants