Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply code formatting to C and C++ files #97

Merged
merged 1 commit into from
May 3, 2024
Merged

Conversation

azriel1rf
Copy link
Collaborator

@azriel1rf azriel1rf commented May 2, 2024

This pull request applies consistent code formatting to the C and C++ source files to improve readability and maintainability. The changes were made using clang-format with the LLVM style, along with some additional manual formatting.

Key changes include:

  • Format code using clang-format with LLVM style (Changed to Google style with discussion Apply code formatting to C and C++ files #97 (review))
  • Delete trailing whitespace
  • Fix mixed line endings to use consistent LF (Unix-style) line endings
  • Ensure all files end with a newline
  • Fix minor formatting issues like inconsistent spacing and indentation

Applying a standard format makes the code easier to read and maintain. It also ensures compatibility with future formatting and linting standards that will be enforced using pre-commit hooks and GitHub Actions in this repository. (#95)

If you have any preferences for the clang-format configuration, please share your .clang-format file and I'll be happy to update the formatting to match.

This is a non-functional change and all tests should continue to pass with the formatting applied. Please let me know if you have any questions or feedback!

Copy link
Owner

@HenryRLee HenryRLee left a comment

Choose a reason for hiding this comment

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

Is there any chance to use Google coding style? Maybe try BasedOnStyle: Google?

I am not very comfortable with this LLVM style, especially the right reference alignment.

If this is not easy to fix, alternatively, there might be an option to override ReferenceAlignment.

Sorry for this big ask. I understand you've done a hard work tidying the format.

@azriel1rf azriel1rf force-pushed the format_cpp branch 2 times, most recently from b65344b to 1b6d948 Compare May 3, 2024 04:36
@azriel1rf
Copy link
Collaborator Author

Thanks for reviewing and providing feedback on the code formatting! I appreciate your preference for the specific coding style and have updated the formatting accordingly.
Thank you for your time and consideration!

Copy link
Owner

@HenryRLee HenryRLee left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks a lot!

@HenryRLee HenryRLee merged commit 1bc79a2 into develop May 3, 2024
6 checks passed
@azriel1rf azriel1rf deleted the format_cpp branch May 3, 2024 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants