8000 Add CMake format by zhjwpku · Pull Request #5 · apache/iceberg-cpp · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@zhjwpku
Copy link
Collaborator
@zhjwpku zhjwpku commented Dec 6, 2024

use the following command to apply the rules to all existing CMakeLists.txt

find . -name CMakeLists.txt | xargs cmake-format -c cmake-format.py -i

${ICEBERG_PUFFIN_SOURCES}
PRIVATE_INCLUDES
${ICEBERG_PUFFIN_INCLUDES})
add_iceberg_lib(iceberg_puffin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be personal preference but I find the original formatting more readable. I don't like this much indentation. Do you think there is a way to configure that?

Copy link
Member

Choose a reason for hiding this comment

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

I simply used the cmake-format plugin in vscode with default setting which formatted these CMake files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I simply used the cmake-format plugin in vscode with default setting which formatted these CMake files.

Yeah, but we need to check the format when PRs are created, I did not include the CI part because I not sure what is the best way to do it. We might consider that together with clang-format.

Copy link
Contributor
@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Before adding source files, I think it would be good to conclude this PR. Any pending concerns? If not, please approve the PR 👍

@gaborkaszab
8000 Copy link
Collaborator

One general question: I see the command in the description that leverages this change to format CMake files. It's up to the contributor to run this manually, and I'm wondering if it makes sense to introduce some build script that runs this, the clang format, and also compiles the project. We'd have more guarantee then that these format requirements are met

@zhjwpku
Copy link
Collaborator Author
zhjwpku commented Dec 13, 2024

One general question: I see the command in the description that leverages this change to format CMake files. It's up to the contributor to run this manually, and I'm wondering if it makes sense to introduce some build script that runs this, the clang format, and also compiles the project. We'd have more guarantee then that these format requirements are met

Make sense, I will try to find some gh actions that are fit for these tasks, maybe after #7 merged.

@gaborkaszab
Copy link
Collaborator

Make sense, I will try to find some gh actions that are fit for these tasks, maybe after #7 merged.

Sounds great, @zhjwpku !
Also some build script that people can run locally would be a nice help for contributors.

Copy link
Collaborator
@gaborkaszab gaborkaszab left a comment

Choose a reason for hiding this comment

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

As discussed, some follow-up PRs would be great for running the formatting mechanisms.

use the following command to apply the rules to all existing
CMakeLists.txt

find . -name CMakeLists.txt | xargs cmake-format -c cmake-format.py -i

Signed-off-by: Junwang Zhao <zhjwpku@gmail.com>
Copy link
Member
@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

+1

nit: should we put cmake-format.py into a sub-folder like scripts or something?

@pitrou
Copy link
Member
pitrou commented Dec 13, 2024

nit: should we put cmake-format.py into a sub-folder like scripts or something?

It's not a script, it's a config file for the cmake-format utility (yes, it's confusing and awkward).

@pitrou
Copy link
Member
pitrou commented Dec 13, 2024

Make sense, I will try to find some gh actions that are fit for these tasks, maybe after #7 merged.

Sounds great, @zhjwpku ! Also some build script that people can run locally would be a nice help for contributors.

We should just use pre-commit, which is able to do both.

@Fokko
Copy link
Contributor
Fokko commented Dec 14, 2024

Thanks for raising this PR @zhjwpku and thanks for the review @gaborkaszab @pitrou and @wgtmac

We should just use pre-commit, which is able to do both.

I love pre-commit 👍

@Fokko Fokko merged commit a5de175 into apache:main Dec 14, 2024
@zhjwpku zhjwpku deleted the add_cmake_format branch December 16, 2024 08:53
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.

5 participants

0