Skip to content

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

Open
muxator wants to merge 5 commits intomainfrom
clang-format
Open

build: introduce clang-format in the code base, enforce via CI#4
muxator wants to merge 5 commits intomainfrom
clang-format

Conversation

@muxator
Copy link
Copy Markdown
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