<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Markus,<div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 2 Jan 2023, at 13:48, Markus Neteler <<a href="mailto:neteler@osgeo.org" class="">neteler@osgeo.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi Nicklas,<br class=""><br class="">On Wed, Dec 21, 2022 at 9:25 PM Nicklas Larsson via grass-dev<br class=""><<a href="mailto:grass-dev@lists.osgeo.org" class="">grass-dev@lists.osgeo.org</a>> wrote:<br class=""><blockquote type="cite" class=""><br class="">I understand there is agreement on using the .clang-format formatting rules suggested with [1], which I just merged.<br class=""><br class="">I have formatted the whole source base with clang-format v.15.0.6, in 7 different PRs [2-8]. I will start merging them tomorrow if there are no objections.<br class=""><br class="">I have also filed a PR [9] which adds a CI check for clang-format errors.<br class=""></blockquote><br class="">Thanks for your efforts on the code reformatting!<br class=""></div></div></blockquote><div><br class=""></div><div>:-)</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">Installing clang-format is perhaps most easily done with:<br class="">python -m pip install 'clang-format==15.0.6'<br class=""><br class="">Formatting may be done with something like (following works on Mac):<br class="">find -E . -regex '.*\.(cpp|hpp|c|h)' -exec clang-format -i {} \+<br class=""></blockquote><br class="">... it fails on Linux, though<br class=""><br class="">find: unknown predicate `-E')<br class=""></div></div></blockquote><div><br class=""></div><div><br class=""></div><div>I was pretty sure this would deviate from Mac/BSD on Linux systems:</div><div><br class=""></div><div><br class=""></div><div>Try something like (untested):</div><div><br class=""></div><div>find . -regex '.*\.(cpp|hpp|c|h)' -exec clang-format -i {} <span style="color: var(--black-800); font-family: var(--ff-mono); font-size: var(--_pr-code-fs); font-style: inherit; font-variant-caps: inherit; white-space: inherit;" class="">\;</span></div><div class=""><br class=""></div><div>or manually with:</div><div>clang-format -I <file></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">Contribution rules must be updated, I will start putting up a draft ASAP.<br class=""></blockquote><br class="">I am trying to fix the conflicts in<br class=""><a href="https://github.com/OSGeo/grass/pull/2684" class="">https://github.com/OSGeo/grass/pull/2684</a><br class=""><br class="">Conflicting files:<br class=""><br class="">include/grass/iostream/mm.h<br class="">lib/db/dbmi_base/dbmscap.c<br class="">lib/external/ccmath/ccmath.h<br class="">lib/gis/spawn.c<br class="">lib/gis/user_config.c<br class="">lib/iostream/rtimer.cpp<br class="">lib/pngdriver/graph_set.c<br class="">lib/rst/interp_float/point2d.c<br class="">raster/r.terraflow/filldepr.cpp<br class="">raster/r.terraflow/flow.cpp<br class="">raster/r.terraflow/main.cpp<br class="">raster/r.viewshed/statusstructure.cpp<br class=""><br class="">The reason will be the missing clang-format update which I don't know<br class="">how to apply on Linux.<br class=""></div></div></blockquote><div><br class=""></div><div>Not quite sure what you mean. Did you try:</div><div><br class=""></div><div>python -m pip install 'clang-format==15.0.6’</div><div><br class=""></div><div>But I suspect any version 15 will do, perhaps even v. 14.</div><div><br class=""></div><div><br class=""></div><div>A tip to use the .clang-format file from main for branches without it:</div><div><br class=""></div><div>1. git checkout main</div><div>2. cp .clang-forrmat ../.clang-format</div><div>3. check out branch</div><div>4. clang-format searches upwards in dir hierarchy  for next ‘.clang-format’ file</div><div>5. run clang-format from grass source dir</div><div><br class=""></div></div><br class=""></div></body></html>