KTX-Software
KTX-Software copied to clipboard
WIP prototype clang-format support
This is largely WIP at this point.
@MarkCallow, this is still WIP as I still have to update the auto-generated files and their scripts to include /* clang-format off */
in order to avoid auto-formatting them, and add clang-tidy support. However, this branch already includes the following:
- Moving external dependencies to the
external
directory - Adding a set of clang-format files specific for the directories in question (e.g.
lib
has a special style file to allow return types on separate lines per the traditional convention) - Running clang-format across all files
Please check the code and let me know whether the new structure and code format seem reasonable to you.
@MarkCallow, I did not yet get feedback from you about the proposed code formatting conventions applied in this branch.
Should I maybe create a separate PR first that just moves the external components into the external
directory (and update build scripts accordingly) to do this step-by-step?
@MarkCallow, I did not yet get feedback from you about the proposed code formatting conventions applied in this branch.
Sorry. I am a little under the weather so working when I feel up to it. I reckon reviewing this is going to take some extended concentration so I've been putting it off. Hopefully I'll feel up to taking a look tomorrow.
Should I maybe create a separate PR first that just moves the external components into the
external
directory (and update build scripts accordingly) to do this step-by-step?
That is not necessary.
I remain somewhat concerned that formatting is done as a workflow rather than via a clean filter run when files are commited. I have to think more about potential ramifications of the remove branch becoming different from what one has just pushed.
Are there any editors that can apply the same formatting during editing?
What is the difference between "format" and "tidy"?
I remain somewhat concerned that formatting is done as a workflow rather than via a clean filter run when files are commited. I have to think more about potential ramifications of the remove branch becoming different from what one has just pushed.
This is the practice used in other Khronos projects: modify, format (automatically or through explicit call), then commit. CI only checks that the modifications match the formatting rules.
Are there any editors that can apply the same formatting during editing?
Many editors have clang-format built-in, AFAICT, but I always do this manually so I don't have much experience with them.
What is the difference between "format" and "tidy"?
clang-format is only dealing with formatting, while clang-tidy is a "linter" and provides higher level analysis, see: https://clang.llvm.org/extra/clang-tidy/
Shall we close this now that #913 exists?
Yes, closing.