Skip to content

Conversation

@slp
Copy link
Collaborator

@slp slp commented Apr 7, 2025

While we use rustfmt and clippy for Rust code, we never settled on a
coding style for the C portions of the project (the init binary). This
has caused the files to divert in style, and in some cases to have
multiple styles mixed in.

Let's settle on a coding style, based on LLVM with a few tweaks to make
it reasonably close to what we were doing so far. We do this by adding
a clang-format configuration file and formatting existing files.

The next commit will extend the tests to ensure PRs adhere to the coding
style in clang-format.

@slp slp changed the title init: set up style code and format files init: set up code style and format files Apr 7, 2025
slp added 2 commits April 7, 2025 17:10
While we use rustfmt and clippy for Rust code, we never settled on a
coding style for the C portions of the project (the init binary). This
has caused the files to divert in style, and in some cases to have
multiple styles mixed in.

Let's settle on a coding style, based on LLVM with a few tweaks to make
it reasonably close to what we were doing so far. We do this by adding
a clang-format configuration file and formatting existing files.

The next commit will extend the tests to ensure PRs adhere to the coding
style in clang-format.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Now that we've settled on a coding style, extend the tests to use
clang-format to ensure PRs adhere to it.

Signed-off-by: Sergio Lopez <slp@redhat.com>
Copy link
Member

@tylerfanelli tylerfanelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@slp slp merged commit 9c3058f into containers:main Apr 8, 2025
6 checks passed
@slp slp deleted the check-c-code branch April 8, 2025 08:01
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.

2 participants