Frank

These changes are independent of the clang-format version. You are most likely missing the file Cactus/.clang-format that defines how to format the code. By default, clang-format assumes C++11 compilers for C++ code, but some machines cannot handle this yet, so we format for the C++03 standard. (This is the option "Standard: Cpp03" in .clang-format.)

-erik

On Mon, Nov 23, 2015 at 3:23 PM, Frank Loeffler <knarf@cct.lsu.edu> wrote:
On Mon, Nov 23, 2015 at 03:13:36PM -0500, Erik Schnetter wrote:
> ... and here is how to reformat your source code:
>
> (1) Install clang-format, which comes with the clang compiler, e.g. the
> "clang-format-3.6" package on Ubuntu
> (2) Run "clang-format -i *.hh *.cc" (the "-i" option modifies files
> in-place)

This is what happens for me:

$ git clone https://bitbucket.org/eschnett/carpet.git
Cloning into 'carpet'...
remote: Counting objects: 42555, done.
remote: Compressing objects: 100% (12129/12129), done.
remote: Total 42555 (delta 31639), reused 40682 (delta 30202)
Receiving objects: 100% (42555/42555), 59.27 MiB | 22.80 MiB/s, done.
Resolving deltas: 100% (31639/31639), done.
Checking connectivity... done.
+knarf@topf:~/ET_dev/repos$ cd carpet/Carpet/src/
+knarf@topf:~/ET_dev/repos/carpet/Carpet/src$ clang-format-3.5 -i *.hh
*.cc
+knarf@topf:~/ET_dev/repos/carpet/Carpet/src$ git diff | wc -l
594

Does this mean we would require clang-format-3.6 (and not supporting
3.5 or earlier)? I thought clang-format wouldn't change the way it
formats stuff in between versions, but it apparently does. One example
from the current changes:

-vector<vector<int> > const &HostProcs() { return host_procs; }
+vector<vector<int>> const &HostProcs() { return host_procs; }

Frank




--
Erik Schnetter <schnetter@gmail.com> http://www.perimeterinstitute.ca/personal/eschnetter/