You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably the only solution to this is to enforce a clang-format version, which can be done via https://pre-commit.ci. I rather dislike this solution: people set-up their editor carefully, they commit some code and push, pre-commit.ci reformats it. They have to pull (presumably). Now their editor reformats it back again. etc. etc. (I guess this would lead the our number of commits increasing with a factor 2, and git fame reporting wrong results).
Another solution is to use a more stable tool than clang-format, and therefore likely change 1000+ files again.
I ran
clang-format
on Ubuntu 22.04. This turns out to be version 14.0.0-1ubuntu1.1. This is also the version run by thepre-commit-check
action,STIR/.github/workflows/pre-commit-check.yml
Line 12 in ee307c7
so it's happy on
master
.Problem
However, I now ran it with latest
clang-format
from conda-forge, which is version 17.0.6. This gives changes in probably 40 files. This is probably a well-known problem, see e.g. https://stackoverflow.com/questions/59395507/how-to-maintain-a-clang-format-file-for-different-clang-format-versions and the post it refers to. It degrades my opinion onclang-format
dramatically.Probably the only solution to this is to enforce a
clang-format
version, which can be done via https://pre-commit.ci. I rather dislike this solution: people set-up their editor carefully, they commit some code and push, pre-commit.ci reformats it. They have to pull (presumably). Now their editor reformats it back again. etc. etc. (I guess this would lead the our number of commits increasing with a factor 2, andgit fame
reporting wrong results).Another solution is to use a more stable tool than
clang-format
, and therefore likely change 1000+ files again.@casperdcl @dvolgyes @markus-jehl any suggestions?
More detail
I'll create a PR with the 17.0.0 version such that the changes can be expected, but I've picked 3 illustrating 3 different categories:trivial
diff --git a/src/utilities/construct_randoms_from_singles.cxx b/src/utilities/construct_randoms_from_singles.cxx index 86c234429..d76ae5ddb 100644 --- a/src/utilities/construct_randoms_from_singles.cxx +++ b/src/utilities/construct_randoms_from_singles.cxx @@ -27,7 +27,7 @@ #include <iostream> #include <fstream> #include <string> -//#include <algorithm> +// #include <algorithm>
weird
beneficial
the following code snippet and the lines below it
STIR/src/test/numerics/test_matrices.cxx
Lines 160 to 166 in ee307c7
The text was updated successfully, but these errors were encountered: