CARTAvis / carta-backend

Source code repository for the backend component of CARTA, a new visualization tool designed for the ALMA, the VLA and the SKA pathfinders.
https://cartavis.github.io/
GNU General Public License v3.0
22 stars 11 forks source link

Format check fails with clang-format 17 #1346

Open pford opened 10 months ago

pford commented 10 months ago

On macOS, brew install clang-format installs version 17.0.6. When you run the style.py script to check formatting with this version, there is a "Bad format" error in every header file where it expects a space between // and #:

< //# Frame.h: represents an open image file
> // # Frame.h: represents an open image file

The workaround is to install the next older version with homebrew; currently, brew install clang-format@11

confluence commented 10 months ago

I've had a look at the docs and I'm pretty sure this is because of SpacesInLineCommentPrefix, introduced in clang-format 13.

Personally I think that this is a good rule, and in the short term we should adjust the code to add the spaces. We don't consistently use this comment format anyway -- it only appears in a few files, and in some cases there is already a space.

It looks like on Ubuntu Jammy (22.04) the default clang-format version is 14, so now is probably a good time to fix this.

In the long term, as we add documentation to the code, this specific type of comment (a description of the file) should be converted to the doxygen-compatible format (as in TileCache.h).