-
Notifications
You must be signed in to change notification settings - Fork 16
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
Automate source code formatting with clang-format
#185
Comments
Will review and comment shortly |
Is it possible to start with CI failing if changed code does not conform-- but only for changed code? If so, let's do that. If not, can we start with having the CI fail if code does not conform, but only for certain specified files? If so, let's do that, starting with If none of the above is feasible, will review further and get back to you. |
Both are feasible. However, I'll recommend to create one single PR first with formatted source code in one go excluding externals libs. |
UPDATEFor future changes, https://clang-format-configurator.site/ should be used instead of https://zed0.co.uk/clang-format-configurator. It supports newer versions and includes other bug fixes. |
UPDATE: By default, |
Hi,
To automate the source code formatting and to keep it consistent throughout,
clang-format
can be configured forzsv
:https://zed0.co.uk/clang-format-configurator/ may be used to generate the
.clang-format
file.Once
.clang-format
is added, the users can configure their editors, e.g. VS Code, to format source files automatically (on demand or on save).The same can be integrated in the CI pipeline as well to enforce a consistent style.
The CI may fail if code is not formatted or it can reformat and commit the formatted files back to repo.
LMK what would be the preferred workflow. I'll update the CI accordingly.
Thanks!
The text was updated successfully, but these errors were encountered: