Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format check fails with clang-format 17 #1346

Open
pford opened this issue Dec 6, 2023 · 1 comment
Open

Format check fails with clang-format 17 #1346

pford opened this issue Dec 6, 2023 · 1 comment
Labels
code maintenance For issues relating to code maintenance and quality
Milestone

Comments

@pford
Copy link
Collaborator

pford commented Dec 6, 2023

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
Copy link
Collaborator

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).

@confluence confluence added the code maintenance For issues relating to code maintenance and quality label Dec 6, 2023
@kswang1029 kswang1029 added this to the v5.0-beta milestone Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code maintenance For issues relating to code maintenance and quality
Projects
No open projects
Status: Backlog
Development

No branches or pull requests

3 participants