[Users] Carpet source code reformatted

Frank Loeffler knarf at cct.lsu.edu
Mon Nov 23 14:23:49 CST 2015


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 at topf:~/ET_dev/repos$ cd carpet/Carpet/src/
+knarf at topf:~/ET_dev/repos/carpet/Carpet/src$ clang-format-3.5 -i *.hh
*.cc
+knarf at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20151123/f2811347/attachment.bin 


More information about the Users mailing list