Skip to content

How can I do code format before I send a PR ? #16335

Answered by beckerhe
knightXun asked this question in Q&A
Discussion options

You must be logged in to vote

You can (and should) use clang-format for code formatting. It's available as a package on basically all Linux distributions.

I recommend using the Git-integration which only formats the lines of code that you have changed.

git clang-format formats all the changes that have not yet been commited.

If you have already committed your changes, then git clang-format HEAD~1 also formats the changes from the last commit.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@knightXun
Comment options

@beckerhe
Comment options

Answer selected by knightXun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants