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

build: introduce clang-format in the code base, enforce via CI #4

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

muxator
Copy link
Contributor

@muxator muxator commented Sep 29, 2023

Individual developers should execute make reformat-code or equivalent at each commit; they can use a pre-commit hook if they want.

The commit also adds a CI workflow that verifies that the tip of a PR (or of main) respects the clang-format rules.

The rules are defined in <BASE>/.clang-format and (for now) are just a small variation of the default LLVM rules. We can change them before merging.

A placeholder has been put in README.md to remember us to document this aspect.

Individual developers should execute "make reformat-code" or equivalent at each
commit; they can use a pre-commit hook if they want.

The commit also adds a CI workflow that verifies that the tip of a PR (or of
main) respects the clang-format rules.
@muxator muxator force-pushed the clang-format branch 3 times, most recently from c76e3cf to 598660a Compare September 29, 2023 11:53
@muxator muxator force-pushed the clang-format branch 3 times, most recently from c7e46c5 to e81ea40 Compare September 29, 2023 12:54
This change has been done individually in order to manually inspect it, as
advised by https://clang.llvm.org/docs/ClangFormatStyleOptions.html#insertbraces:
    Setting this option to true could lead to incorrect code formatting due to
    clang-format’s lack of complete semantic information. As such, extra care
    should be taken to review code changes made by this option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant