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

Add clang-formating for c sources and headers. #790

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vehre
Copy link
Collaborator

@vehre vehre commented Oct 15, 2024

coverage on master
Codecov branch

Summary of changes

Unify formatting of C sources utilizing a tool available on all platforms.

Rationale for changes

Editing the sources always lead to indentation and formatting getting ugly or I had to manually fix the formatting my IDE did. I therefore opted to use a tool (clang-format) that is widely available and can be configured to have the code look very similar to the previous version. Furthermore does is support partial formatting in IDEs, i.e. only code that is edited is reformatted.

Additional info and certifications

This pull request (PR) is a:

  • Bug fix
  • Feature addition
  • Other, Please describe:

I certify that

  • I certify that:
    • I have reviewed and followed the contributing guidelines
    • I will wait at least 24 hours before self-approving the PR to give another
      OpenCoarrays developer a chance to review my proposed code
    • I have not introduced errant white space (no trailing white space or white space errors may
      be introduced)
    • I have added an explanation of what these changes do and why they should be included
    • I have checked to ensure there aren't other open Pull Requests for the same change
    • I have you written new tests for these changes
    • I have successfully tested these changes locally
    • I have commented any non-trivial, non-obvious code changes
    • The commits are logically atomic, self consistent and coherent
    • The commit messages follow best practices
    • Test coverage is maintained or increased after this is merged

Code coverage data

coverage on master

Add a .clang-format file to the top-level source dir.
Add clang-format lookup to CMakeLists.txt and use it for checking
in the pre-commit git hook.
Format mpi-driver c sources/headers using clang-format.
@vehre vehre requested review from zbeekman and rouson October 15, 2024 10:51
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.

1 participant