-
How can I do code format before I send a PR ? |
Beta Was this translation helpful? Give feedback.
Answered by
beckerhe
Aug 22, 2024
Replies: 1 comment 2 replies
-
You can (and should) use I recommend using the Git-integration which only formats the lines of code that you have changed.
If you have already committed your changes, then |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
knightXun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.