tlapack icon indicating copy to clipboard operation
tlapack copied to clipboard

update clang-format to version 18

Open thijssteel opened this issue 2 months ago • 5 comments

Closes issue #522

I updated clang-format to version 18, mostly because I don't have version 11 available locally and that was annoying.

4000 lines changes may seem like a lot, but I thought it would be a lot worse.

I don't have a good explanation for why the CI is failing. clang-format-18 does not result in any changes on my laptop. Will need some further investigation.

thijssteel avatar Nov 05 '25 08:11 thijssteel

It's great. Thanks. I see that there is still one issue somewhere. But we had the same issue this Summer and we were using the CI to tell us whether formatting was good or not, as opposed to be using clangformat on our machine. Thanks!

langou avatar Nov 07 '25 16:11 langou

I was ultimately able to just build llvm from source so that I could still use clang-format-11 on my laptop. No longer a big issue for me, though it would still be nice to update at some point.

thijssteel avatar Nov 07 '25 16:11 thijssteel

OK. Cool. I will try this trick on my laptop too. Thanks. That was a pain. I had not thought about changing the clangformat version on my laptop. Good idea.

That being said, well, yes, it would be nicer to update on the CI side! But not a priority!

langou avatar Nov 07 '25 16:11 langou

One note is that while I was able to change the clang-format version on my laptop, this version is too old to integrate with vscode, so it always needs to be run manually.

thijssteel avatar Nov 07 '25 16:11 thijssteel

Hey! Sorry for the delay to comment. Great that you have some time to contribute new stuff!

I've been thinking... I don't like the CI telling us that we need to format our code. It makes more difficult to people to contribute. Instead, I think we should have an auto-formatting task that will go over the code before every merge request. I think this is doable, and git seems to provide those kind of tasks. What do you think?

I don't have time to work on that now, but maybe you let this PR open so we remember something needs to be done.

weslleyspereira avatar Nov 14 '25 15:11 weslleyspereira

That actually sounds like a great idea. Would remove at least some of the burden from the developers.

Although I have sometimes noticed that the automatic fixes are not great. Especially for the indentation in the documentation. But I guess to avoid that, the developer can still install clang-format locally, even a different version should still be roughly fine.

thijssteel avatar Nov 25 '25 13:11 thijssteel